Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 2 additions & 68 deletions lib/interface/cli/commands/argocd/install.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,81 +15,15 @@ const installArgoCmd = new Command({
weight: 100,
},
builder: yargs => yargs
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
.option('token', {
describe: 'Codefresh user token',
})
.option('kube-context-name', {
describe: 'Name of the kubernetes context on which argocd-agent should be installed [$CF_ARG_KUBE_CONTEXT_NAME]',
})
.option('url', {
describe: 'Codefresh url, by default https://g.codefresh.io',
})
.option('kube-namespace', {
describe: 'Name of the namespace on which argocd-agent should be installed [$CF_ARG_KUBE_NAMESPACE]',
})
.option('argo-host', {
describe: 'Argocd host, exaple is https://argohost.com',
})
.option('argo-username', {
describe: 'Argocd admin username',
})
.option('argo-password', {
describe: 'Argocd admin password',
}),
handler: async (argv) => {
const {
url,
token,
'kube-context-name': kubeContextName,
'kube-namespace': kubeNamespace,
'argo-host': argoHost,
'argo-password': argoPassword,
'argo-username': argoUsername,
} = argv;
.env('CF_ARG_'),
handler: async () => {
const binLocation = await downloadArgo();
const componentRunner = new Runner(binLocation);

const commands = [
'install',
];

if (token) {
commands.push('--codefresh-token');
commands.push(token);
}

if (kubeContextName) {
commands.push('--kube-context-name');
commands.push(kubeContextName);
}

if (kubeNamespace) {
commands.push('--kube-namespace');
commands.push(kubeNamespace);
}

if (url) {
commands.push('--codefresh-host');
commands.push(url);
}

if (argoHost) {
commands.push('--argo-host');
commands.push(argoHost);
}

if (argoPassword) {
commands.push('--argo-password');
commands.push(argoPassword);
}

if (argoUsername) {
commands.push('--argo-username');
commands.push(argoUsername);
}


await componentRunner.run(components.argo, commands);
},
});
Expand Down
27 changes: 2 additions & 25 deletions lib/interface/cli/commands/argocd/uninstall.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,13 @@ const unInstallAgentCmd = new Command({
weight: 100,
},
builder: yargs => yargs
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
.option('kube-context-name', {
describe: 'Name of the kubernetes context on which argocd-agent should be uninstalled [$CF_ARG_KUBE_CONTEXT_NAME]',
})
.option('kube-namespace', {
describe: 'Name of the namespace on which argocd-agent should be uninstalled [$CF_ARG_KUBE_NAMESPACE]',
}),
handler: async (argv) => {
const {
'kube-namespace': kubeNamespace,
'kube-context-name': kubeContextName,
} = argv;

.env('CF_ARG_'),
handler: async () => {
const binLocation = await downloadArgo();
const componentRunner = new Runner(binLocation);

const commands = [
'uninstall',
];

if (kubeContextName) {
commands.push('--kube-context-name');
commands.push(kubeContextName);
}

if (kubeNamespace) {
commands.push('--kube-namespace');
commands.push(kubeNamespace);
}

await componentRunner.run(components.argo, commands);
},
});
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.72.5",
"version": "0.72.6",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down