-
Notifications
You must be signed in to change notification settings - Fork 45
/
secret-schema.yaml
293 lines (274 loc) · 14.8 KB
/
secret-schema.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
apiVersion: secret.jenkins-x.io/v1alpha1
kind: Schema
spec:
objects:
- name: jx-basic-auth-user-password
mandatory: true
properties:
- name: username
question: the username for basic auth ingresses
help: The username to login to basic authenticated URLs
defaultValue: admin
- name: password
question: the password for basic auth ingresses
help: The password to login to basic authenticated URLs
minLength: 5
maxLength: 41
generator: password
- name: jx-basic-auth-htpasswd
properties:
- name: auth
question: the htpasswd format basic auth for Ingress
help: The htpasswd encoded user and password for basic auth ingresses
retry: true
template: |-
{{ htpasswdExtSecret "jx-basic-auth-user-password" "username" "password" }}
onlyTemplateIfBlank: true
- name: jenkins-release-gpg
properties:
- name: pubring.gpg
question: The gpg public ring
# lets force the secret to be created with dummy values until the user really populates it
defaultValue: todo
- name: jenkins-maven-settings
properties:
- name: settings.xml
question: Maven settings XML contents
help: This is the maven settings XML which is mounted for Java builds
noMask: true
template: |-
<settings>
<localRepository>/home/jenkins/.mvnrepository</localRepository>
<!--This sends everything else to /public -->
{{- if and (hasKey .Requirements "repository") (eq .Requirements.repository "bucketrepo") }}
<mirrors>
<mirror>
<id>bucketrepo</id>
<name>bucketrepo mirror</name>
<mirrorOf>*</mirrorOf>
<url>http://bucketrepo/bucketrepo/</url>
</mirror>
</mirrors>
{{- else if and (hasKey .Requirements "repository") (eq .Requirements.repository "none") }}
<mirrors>
<mirror>
<id>central</id>
<name>US Central</name>
<url>https://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>UK</id>
<name>UK Central</name>
<url>https://uk.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
{{- else }}
<mirrors>
<mirror>
<id>nexus</id>
<name>nexus mirror</name>
<mirrorOf>central</mirrorOf>
<url>http://nexus/repository/maven-group/</url>
</mirror>
</mirrors>
{{- end }}
<!-- lets disable the download progress indicator that fills up logs -->
<interactiveMode>false</interactiveMode>
<servers>
<server>
<id>local-nexus</id>
<username>{{ extsecret "nexus" "username" | default "admin"}}</username>
<password>{{ extsecret "nexus" "password" }}</password>
</server>
<server>
<id>nexus</id>
<username>{{ extsecret "nexus" "username" | default "admin"}}</username>
<password>{{ extsecret "nexus" "password" }}</password>
</server>
<server>
<id>chartmuseum</id>
<username>{{ extsecret "jenkins-x-chartmuseum" "username" }}</username>
<password>{{ extsecret "jenkins-x-chartmuseum" "password" }}</password>
</server>
<server>
<id>bucketrepo</id>
<username>{{ extsecret "jenkins-x-bucketrepo" "username" }}</username>
<password>{{ extsecret "jenkins-x-bucketrepo" "password" }}</password>
</server>
<server>
<id>oss-sonatype-staging</id>
<username>{{ extsecret "sonatype" "username" }}</username>
<password>{{ extsecret "sonatype" "password" }}</password>
</server>
<server>
<id>docker.io</id>
<username>{{ extsecret "docker-hub" "username" }}</username>
<password>{{ extsecret "docker-hub" "password" }}</password>
</server>
<server>
<id>github</id>
<username>{{ extsecret "tekton-git" "username" }}</username>
<password>{{ extsecret "tekton-git" "password" }}</password>
</server>
{{- if and (hasKey .Requirements "repository") (not (eq .Requirements.repository "bucketrepo")) (not (eq .Requirements.repository "nexus")) (not (eq .Requirements.repository "github")) (not (eq .Requirements.repository "")) }}
<server>
<id>{{ .Requirements.repository }}</id>
<username>{{ extsecret .Requirements.repository "username" }}</username>
<password>{{ extsecret .Requirements.repository "password" }}</password>
</server>
{{- end }}
</servers>
<profiles>
<profile>
<id>nexus</id>
<properties>
{{- if and (hasKey .Requirements "repository") (eq .Requirements.repository "bucketrepo") }}
<altDeploymentRepository>local-nexus::default::http://bucketrepo/bucketrepo/</altDeploymentRepository>
<altReleaseDeploymentRepository>local-nexus::default::http://bucketrepo/bucketrepo/</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>local-nexus::default::http://bucketrepo/bucketrepo/snapshots/</altSnapshotDeploymentRepository>
{{- else if and (hasKey .Requirements "repository") (eq .Requirements.repository "github") }}
{{- if and (hasKey .Requirements "repositories") (hasKey .Requirements.repositories "maven") (hasKey .Requirements.repositories.maven "releaseUrl") }}
<altDeploymentRepository>github::default::{{ .Requirements.repositories.maven.releaseUrl }}</altDeploymentRepository>
<altReleaseDeploymentRepository>github::default::{{ .Requirements.repositories.maven.releaseUrl }}</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>github::default::{{ .Requirements.repositories.maven.snapshotUrl | default .Requirements.repositories.maven.releaseUrl }}</altSnapshotDeploymentRepository>
{{- else }}
<!-- TODO add a specific github package after https://maven.pkg.github.com/ like https://maven.pkg.github.com/myorg/myrepo -->
<altDeploymentRepository>github::default::https://maven.pkg.github.com/</altDeploymentRepository>
<altReleaseDeploymentRepository>github::default::https://maven.pkg.github.com/</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>github::default::https://maven.pkg.github.com/</altSnapshotDeploymentRepository>
{{- end }}
{{- else if not (hasKey .Requirements "repository") }}
<altDeploymentRepository>local-nexus::default::http://nexus/repository/maven-releases/</altDeploymentRepository>
<altReleaseDeploymentRepository>local-nexus::default::http://nexus/repository/maven-releases/</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>local-nexus::default::http://nexus/repository/maven-snapshots/</altSnapshotDeploymentRepository>
{{- else if and (hasKey .Requirements "repository") (or (eq .Requirements.repository "nexus") (eq .Requirements.repository "") ) }}
<altDeploymentRepository>local-nexus::default::http://nexus/repository/maven-releases/</altDeploymentRepository>
<altReleaseDeploymentRepository>local-nexus::default::http://nexus/repository/maven-releases/</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>local-nexus::default::http://nexus/repository/maven-snapshots/</altSnapshotDeploymentRepository>
{{- else }}
<altDeploymentRepository>local-nexus::{{ .Requirements.repository }}::{{ .Requirements.repositories.maven.releaseUrl }}</altDeploymentRepository>
<altReleaseDeploymentRepository>local-nexus::{{ .Requirements.repository }}::{{ .Requirements.repositories.maven.releaseUrl }}</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>local-nexus::{{ .Requirements.repository }}::{{ .Requirements.repositories.maven.snapshotUrl | default .Requirements.repositories.maven.releaseUrl }}</altSnapshotDeploymentRepository>
{{- end }}
</properties>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>repo.jenkins-ci.org</id>
<properties>
<altDeploymentRepository>repo.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/</altDeploymentRepository>
<altReleaseDeploymentRepository>repo.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>repo.jenkins-ci.org::default::https://repo.jenkins-ci.org/snapshots/</altSnapshotDeploymentRepository>
</properties>
</profile>
<profile>
<id>maven.jenkins-ci.org</id>
<properties>
<altDeploymentRepository>maven.jenkins-ci.org::default::https://maven.jenkins-ci.org/releases/</altDeploymentRepository>
<altReleaseDeploymentRepository>maven.jenkins-ci.org::default::https://maven.jenkins-ci.org/releases/</altReleaseDeploymentRepository>
<altSnapshotDeploymentRepository>maven.jenkins-ci.org::default::https://maven.jenkins-ci.org/snapshots/</altSnapshotDeploymentRepository>
</properties>
</profile>
<profile>
<id>release</id>
<properties>
<gpg.executable>gpg</gpg.executable>
<!-- TODO use: .Parameters.gpg.passphrase when it is always populated -->
<gpg.passphrase>{{ extsecret "gpg" "passphrase" }}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
- name: settings-security.xml
question: Maven security XML contents
help: This is the maven security XML which is mounted for Java builds
noMask: true
template: |-
<settingsSecurity/>
- name: tekton-git
mandatory: true
properties:
- name: username
noMask: true
key: secret/data/jx/pipelineUser
question: the pipeline username
help: the user name used by pipelines running in Jenkins X
generator: gitOperator.username
- name: password
key: secret/data/jx/pipelineUser
question: the pipeline token or password
help: the token or password used by pipelines running in Jenkins X
generator: gitOperator.password
- name: tekton-container-registry-auth
mandatory: true
properties:
- name: .dockerconfigjson
question: Docker JSON Configuration
noMask: true
help: This is the docker JSON configuration for authenticating with container
registries
template: |-
{
{{- if eq .Requirements.cluster.provider "gke" }}
"credHelpers": {
"gcr.io": "gcr",
"us.gcr.io": "gcr",
"eu.gcr.io": "gcr",
"asia.gcr.io": "gcr",
"staging-k8s.gcr.io": "gcr"
},
{{- else if and (eq .Requirements.cluster.provider "eks") (hasKey .Requirements "cluster") (hasKey .Requirements.cluster "registry") (contains "aws" .Requirements.cluster.registry) }}
{{- if and (hasKey .Requirements "cluster") (hasKey .Requirements.cluster "registry") (not (eq .Requirements.cluster.registry (secret "jx.container-registry-auth" "url"))) }}
"credHelpers": {
"{{ .Requirements.cluster.registry }}": "ecr-login"
},
{{- end }}
{{- else if eq .Requirements.cluster.provider "aws" }}
"credsStore": "ecr-login",
{{- else if eq .Requirements.cluster.provider "aks" }}
{{- if and (hasKey .Requirements "cluster") (hasKey .Requirements.cluster "registry") (not (eq .Requirements.cluster.registry (secret "jx.container-registry-auth" "url"))) }}
"credHelpers": {
"{{ .Requirements.cluster.registry }}": "acr-env"
},
{{- end }}
{{- end }}
"auths":{
{{- if secret "jx.container-registry-auth" "password" }}
{{ secret "jx.container-registry-auth" "url" | default "https://index.docker.io/v1/" | quote }}: {
"auth": {{ auth "jx.container-registry-auth" "username" "password" | b64enc | quote}},
"email": {{ secret "jx.container-registry-auth" "email" | default "jenkins-x@googlegroups.com" | quote }}
}
{{- end }}
{{- if or (eq .Requirements.cluster.gitServer "https://github.com") (eq .Requirements.cluster.gitServer "https://github.com/") }}
{{- if secret "jx.container-registry-auth" "password" }}
,
{{- end }}
"ghcr.io": {
{{- if secret "jx-git-operator.jx-boot" "email" }}
"email": {{ secret "jx-git-operator.jx-boot" "email" | quote }},
{{- end }}
"auth": {{ auth "jx-git-operator.jx-boot" "username" "password" | b64enc | quote}}
}
{{- end }}
}
}