@@ -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} ) ;
0 commit comments