Skip to content

Commit 3836d86

Browse files
use only interactive installation flow (#560)
1 parent 8ce1fea commit 3836d86

File tree

3 files changed

+5
-94
lines changed

3 files changed

+5
-94
lines changed

lib/interface/cli/commands/argocd/install.cmd.js

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,81 +15,15 @@ const installArgoCmd = new Command({
1515
weight: 100,
1616
},
1717
builder: yargs => yargs
18-
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
19-
.option('token', {
20-
describe: 'Codefresh user token',
21-
})
22-
.option('kube-context-name', {
23-
describe: 'Name of the kubernetes context on which argocd-agent should be installed [$CF_ARG_KUBE_CONTEXT_NAME]',
24-
})
25-
.option('url', {
26-
describe: 'Codefresh url, by default https://g.codefresh.io',
27-
})
28-
.option('kube-namespace', {
29-
describe: 'Name of the namespace on which argocd-agent should be installed [$CF_ARG_KUBE_NAMESPACE]',
30-
})
31-
.option('argo-host', {
32-
describe: 'Argocd host, exaple is https://argohost.com',
33-
})
34-
.option('argo-username', {
35-
describe: 'Argocd admin username',
36-
})
37-
.option('argo-password', {
38-
describe: 'Argocd admin password',
39-
}),
40-
handler: async (argv) => {
41-
const {
42-
url,
43-
token,
44-
'kube-context-name': kubeContextName,
45-
'kube-namespace': kubeNamespace,
46-
'argo-host': argoHost,
47-
'argo-password': argoPassword,
48-
'argo-username': argoUsername,
49-
} = argv;
18+
.env('CF_ARG_'),
19+
handler: async () => {
5020
const binLocation = await downloadArgo();
5121
const componentRunner = new Runner(binLocation);
5222

5323
const commands = [
5424
'install',
5525
];
5626

57-
if (token) {
58-
commands.push('--codefresh-token');
59-
commands.push(token);
60-
}
61-
62-
if (kubeContextName) {
63-
commands.push('--kube-context-name');
64-
commands.push(kubeContextName);
65-
}
66-
67-
if (kubeNamespace) {
68-
commands.push('--kube-namespace');
69-
commands.push(kubeNamespace);
70-
}
71-
72-
if (url) {
73-
commands.push('--codefresh-host');
74-
commands.push(url);
75-
}
76-
77-
if (argoHost) {
78-
commands.push('--argo-host');
79-
commands.push(argoHost);
80-
}
81-
82-
if (argoPassword) {
83-
commands.push('--argo-password');
84-
commands.push(argoPassword);
85-
}
86-
87-
if (argoUsername) {
88-
commands.push('--argo-username');
89-
commands.push(argoUsername);
90-
}
91-
92-
9327
await componentRunner.run(components.argo, commands);
9428
},
9529
});

lib/interface/cli/commands/argocd/uninstall.cmd.js

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,13 @@ const unInstallAgentCmd = new Command({
1616
weight: 100,
1717
},
1818
builder: yargs => yargs
19-
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
20-
.option('kube-context-name', {
21-
describe: 'Name of the kubernetes context on which argocd-agent should be uninstalled [$CF_ARG_KUBE_CONTEXT_NAME]',
22-
})
23-
.option('kube-namespace', {
24-
describe: 'Name of the namespace on which argocd-agent should be uninstalled [$CF_ARG_KUBE_NAMESPACE]',
25-
}),
26-
handler: async (argv) => {
27-
const {
28-
'kube-namespace': kubeNamespace,
29-
'kube-context-name': kubeContextName,
30-
} = argv;
31-
19+
.env('CF_ARG_'),
20+
handler: async () => {
3221
const binLocation = await downloadArgo();
3322
const componentRunner = new Runner(binLocation);
34-
3523
const commands = [
3624
'uninstall',
3725
];
38-
39-
if (kubeContextName) {
40-
commands.push('--kube-context-name');
41-
commands.push(kubeContextName);
42-
}
43-
44-
if (kubeNamespace) {
45-
commands.push('--kube-namespace');
46-
commands.push(kubeNamespace);
47-
}
48-
4926
await componentRunner.run(components.argo, commands);
5027
},
5128
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.72.5",
3+
"version": "0.72.6",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)