@@ -5,13 +5,12 @@ const installRoot = require('../root/install.cmd');
55const { detectProxy } = require ( '../../helpers/general' ) ;
66const { downloadProvider } = require ( '../hybrid/helper' ) ;
77const { Runner, components } = require ( '../../../../binary' ) ;
8- const { install : installArgocd } = require ( './install-argocd' ) ;
98
109const installArgoCmd = new Command ( {
1110 root : false ,
1211 parent : installRoot ,
1312 command : 'gitops <provider>' ,
14- description : 'Install gitops' ,
13+ description : 'Install gitops agent ' ,
1514 webDocs : {
1615 category : 'Gitops' ,
1716 title : 'Install' ,
@@ -21,14 +20,14 @@ const installArgoCmd = new Command({
2120 . env ( 'CF_ARG_' )
2221 . positional ( 'provider' , {
2322 describe : 'Gitops provider' ,
24- choices : [ 'codefresh' , ' argocd-agent'] ,
23+ choices : [ 'argocd-agent' ] ,
2524 required : true ,
2625 } )
2726 . option ( 'git-integration' , {
2827 describe : 'Name of git integration in Codefresh' ,
2928 } )
3029 . option ( 'codefresh-integration' , {
31- describe : 'Name of gitops integration in Codefresh' ,
30+ describe : 'Name of argocd integration in Codefresh' ,
3231 } )
3332 . option ( 'argo-host' , {
3433 describe : 'Host of argocd installation' ,
@@ -37,14 +36,13 @@ const installArgoCmd = new Command({
3736 describe : 'Token of argocd installation. Preferred auth method' ,
3837 } )
3938 . option ( 'argo-username' , {
40- default : 'admin' ,
41- describe : 'Username of existing argocd installation. Should be used with argo-password' ,
39+ describe : 'Username of argocd installation. Should be used with argo-password' ,
4240 } )
4341 . option ( 'argo-password' , {
44- describe : 'Password of existing argocd installation. Should be used with argo-username' ,
42+ describe : 'Username of argocd installation. Should be used with argo-username' ,
4543 } )
4644 . option ( 'update' , {
47- describe : 'Update gitops integration if exists' ,
45+ describe : 'Update argocd integration if exists' ,
4846 } )
4947 . option ( 'kube-config-path' , {
5048 describe : 'Path to kubeconfig file (default is $HOME/.kube/config)' ,
@@ -72,53 +70,16 @@ const installArgoCmd = new Command({
7270 } )
7371 . option ( 'https-proxy' , {
7472 describe : 'https proxy to be used in the runner' ,
75- } )
76- // argocd options
77- . option ( 'install-manifest' , {
78- describe : 'Url of argocd install manifest' ,
79- default : 'https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml' ,
80- } )
81- . option ( 'set-argo-password' , {
82- describe : 'Set password for admin user of new argocd installation' ,
8373 } ) ,
8474 handler : async ( argv ) => {
8575 let {
76+ // eslint-disable-next-line prefer-const
77+ 'kube-config-path' : kubeConfigPath ,
78+ // eslint-disable-next-line prefer-const
8679 provider,
8780 'http-proxy' : httpProxy ,
8881 'https-proxy' : httpsProxy ,
89- 'argo-host' : argoHost ,
90- 'argo-username' : argoUsername ,
91- 'argo-password' : argoPassword ,
9282 } = argv ;
93- const {
94- 'kube-config-path' : kubeConfigPath ,
95- 'install-manifest' : installManifest ,
96- 'kube-namespace' : kubeNamespace ,
97- 'set-argo-password' : setArgoPassword ,
98- } = argv ;
99-
100- if ( provider === 'codefresh' ) {
101- if ( ! setArgoPassword ) {
102- console . error ( '\nMissing required argument: set-argo-password' ) ;
103- process . exit ( 1 ) ;
104- }
105-
106- if ( ! kubeNamespace ) {
107- console . error ( '\nMissing required argument: kube-namespace' ) ;
108- process . exit ( 1 ) ;
109- }
110-
111- const result = await installArgocd ( {
112- installManifest,
113- kubeNamespace,
114- setArgoPassword,
115- } ) ;
116-
117- provider = 'argocd-agent' ;
118- argoHost = result . host ;
119- argoUsername = 'admin' ;
120- argoPassword = setArgoPassword ;
121- }
12283
12384 const binLocation = await downloadProvider ( { provider } ) ;
12485 const componentRunner = new Runner ( binLocation ) ;
@@ -132,11 +93,8 @@ const installArgoCmd = new Command({
13293 commands . push ( kubeConfigPath ) ;
13394 }
13495
135- const installOptions = _ . pick ( argv , [ 'git-integration' , 'codefresh-integration' , 'argo-token' , 'output' ,
136- 'update' , 'kube-context-name' , 'kube-namespace' , 'sync-mode' , 'sync-apps' ] ) ;
137- installOptions [ 'argo-host' ] = argoHost ;
138- installOptions [ 'argo-username' ] = argoUsername ;
139- installOptions [ 'argo-password' ] = argoPassword ;
96+ const installOptions = _ . pick ( argv , [ 'git-integration' , 'codefresh-integration' , 'argo-host' , 'argo-token' , 'output' ,
97+ 'argo-username' , 'argo-password' , 'update' , 'kube-context-name' , 'kube-namespace' , 'sync-mode' , 'sync-apps' ] ) ;
14098
14199 _ . forEach ( installOptions , ( value , key ) => {
142100 if ( _ . isArray ( value ) ) {
0 commit comments