@@ -5,13 +5,12 @@ const installRoot = require('../root/install.cmd');
5
5
const { detectProxy } = require ( '../../helpers/general' ) ;
6
6
const { downloadProvider } = require ( '../hybrid/helper' ) ;
7
7
const { Runner, components } = require ( '../../../../binary' ) ;
8
- const { install : installArgocd } = require ( './install-argocd' ) ;
9
8
10
9
const installArgoCmd = new Command ( {
11
10
root : false ,
12
11
parent : installRoot ,
13
12
command : 'gitops <provider>' ,
14
- description : 'Install gitops' ,
13
+ description : 'Install gitops agent ' ,
15
14
webDocs : {
16
15
category : 'Gitops' ,
17
16
title : 'Install' ,
@@ -21,14 +20,14 @@ const installArgoCmd = new Command({
21
20
. env ( 'CF_ARG_' )
22
21
. positional ( 'provider' , {
23
22
describe : 'Gitops provider' ,
24
- choices : [ 'codefresh' , ' argocd-agent'] ,
23
+ choices : [ 'argocd-agent' ] ,
25
24
required : true ,
26
25
} )
27
26
. option ( 'git-integration' , {
28
27
describe : 'Name of git integration in Codefresh' ,
29
28
} )
30
29
. option ( 'codefresh-integration' , {
31
- describe : 'Name of gitops integration in Codefresh' ,
30
+ describe : 'Name of argocd integration in Codefresh' ,
32
31
} )
33
32
. option ( 'argo-host' , {
34
33
describe : 'Host of argocd installation' ,
@@ -37,14 +36,13 @@ const installArgoCmd = new Command({
37
36
describe : 'Token of argocd installation. Preferred auth method' ,
38
37
} )
39
38
. 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' ,
42
40
} )
43
41
. 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' ,
45
43
} )
46
44
. option ( 'update' , {
47
- describe : 'Update gitops integration if exists' ,
45
+ describe : 'Update argocd integration if exists' ,
48
46
} )
49
47
. option ( 'kube-config-path' , {
50
48
describe : 'Path to kubeconfig file (default is $HOME/.kube/config)' ,
@@ -72,53 +70,16 @@ const installArgoCmd = new Command({
72
70
} )
73
71
. option ( 'https-proxy' , {
74
72
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' ,
83
73
} ) ,
84
74
handler : async ( argv ) => {
85
75
let {
76
+ // eslint-disable-next-line prefer-const
77
+ 'kube-config-path' : kubeConfigPath ,
78
+ // eslint-disable-next-line prefer-const
86
79
provider,
87
80
'http-proxy' : httpProxy ,
88
81
'https-proxy' : httpsProxy ,
89
- 'argo-host' : argoHost ,
90
- 'argo-username' : argoUsername ,
91
- 'argo-password' : argoPassword ,
92
82
} = 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
- }
122
83
123
84
const binLocation = await downloadProvider ( { provider } ) ;
124
85
const componentRunner = new Runner ( binLocation ) ;
@@ -132,11 +93,8 @@ const installArgoCmd = new Command({
132
93
commands . push ( kubeConfigPath ) ;
133
94
}
134
95
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' ] ) ;
140
98
141
99
_ . forEach ( installOptions , ( value , key ) => {
142
100
if ( _ . isArray ( value ) ) {
0 commit comments