Skip to content

Commit

Permalink
rename provider (#603)
Browse files Browse the repository at this point in the history
* rename provider
* validate argument
  • Loading branch information
andrii-codefresh committed Dec 9, 2020
1 parent 6e97b80 commit 7435919
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions lib/interface/cli/commands/gitops/install.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const installArgoCmd = new Command({
root: false,
parent: installRoot,
command: 'gitops <provider>',
description: 'Install gitops agent',
description: 'Install gitops',
webDocs: {
category: 'Gitops',
title: 'Install',
Expand All @@ -21,14 +21,14 @@ const installArgoCmd = new Command({
.env('CF_ARG_')
.positional('provider', {
describe: 'Gitops provider',
choices: ['argocd', 'argocd-agent'],
choices: ['codefresh', 'argocd-agent'],
required: true,
})
.option('git-integration', {
describe: 'Name of git integration in Codefresh',
})
.option('codefresh-integration', {
describe: 'Name of argocd integration in Codefresh',
describe: 'Name of gitops integration in Codefresh',
})
.option('argo-host', {
describe: 'Host of argocd installation',
Expand All @@ -44,7 +44,7 @@ const installArgoCmd = new Command({
describe: 'Password of existing argocd installation. Should be used with argo-username',
})
.option('update', {
describe: 'Update argocd integration if exists',
describe: 'Update gitops integration if exists',
})
.option('kube-config-path', {
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
Expand Down Expand Up @@ -75,11 +75,11 @@ const installArgoCmd = new Command({
})
// argocd options
.option('install-manifest', {
describe: 'url of argocd install manifest',
describe: 'Url of argocd install manifest',
default: 'https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml',
})
.option('set-argo-password', {
describe: 'set password for admin user of new argocd installation',
describe: 'Set password for admin user of new argocd installation',
}),
handler: async (argv) => {
let {
Expand All @@ -97,12 +97,17 @@ const installArgoCmd = new Command({
'set-argo-password': setArgoPassword,
} = argv;

if (provider === 'argocd') {
if (provider === 'codefresh') {
if (!setArgoPassword) {
console.error('\nMissing required argument: set-argo-password');
process.exit(1);
}

if (!kubeNamespace) {
console.error('\nMissing required argument: kube-namespace');
process.exit(1);
}

const result = await installArgocd({
installManifest,
kubeNamespace,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.73.26",
"version": "0.73.27",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down

0 comments on commit 7435919

Please sign in to comment.