You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: deploy/install.sh
+24-4Lines changed: 24 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,26 @@ bitbucket_auth=""
17
17
bitbucket_webhook_secret=""
18
18
nexus_auth=""
19
19
private_cert=""
20
+
# Templates
21
+
basicAuthSecretTemplate="apiVersion: v1
22
+
kind: Secret
23
+
metadata:
24
+
name: '{{name}}'
25
+
labels:
26
+
app.kubernetes.io/name: ods-pipeline
27
+
stringData:
28
+
password: '{{password}}'
29
+
username: '{{username}}'
30
+
type: kubernetes.io/basic-auth"
31
+
opaqueSecretTemplate="apiVersion: v1
32
+
kind: Secret
33
+
metadata:
34
+
name: '{{name}}'
35
+
labels:
36
+
app.kubernetes.io/name: ods-pipeline
37
+
stringData:
38
+
secret: '{{password}}'
39
+
type: Opaque"
20
40
21
41
# Check prerequisites.
22
42
kubectl_bin=""
@@ -120,7 +140,7 @@ kubectlApplySecret () {
120
140
# To avoid forward slashes messing up sed, escape forward slashes first.
121
141
# See https://tldp.org/LDP/abs/html/string-manipulation.html.
122
142
# shellcheck disable=SC2002
123
-
cat"${secretTemplate}"| sed "s/{{name}}/${secretName}/"| sed "s/{{username}}/${username//\//\\/}/"| sed "s/{{password}}/${password//\//\\/}/"|"${kubectl_bin}" -n "${namespace}" apply -f -
143
+
echo"${secretTemplate}"| sed "s/{{name}}/${secretName}/"| sed "s/{{username}}/${username//\//\\/}/"| sed "s/{{password}}/${password//\//\\/}/"|"${kubectl_bin}" -n "${namespace}" apply -f -
124
144
}
125
145
126
146
installSecret () {
@@ -216,20 +236,20 @@ if [ "${dry_run}" == "true" ]; then
216
236
else
217
237
# Bitbucket username is not required as PAT alone is enough.
218
238
installSecret "ods-bitbucket-auth" \
219
-
"basic-auth-secret.yaml.tmpl" \
239
+
"${basicAuthSecretTemplate}" \
220
240
"${bitbucket_auth}" \
221
241
"Please enter the username of Bitbucket user with write permission." \
222
242
"Please enter a personal access token of this Bitbucket user (input will be hidden):"
223
243
224
244
# Webhook secret is a special case, as we do not want the user to set it.
225
245
# No prompts -> password will be auto-generated if not given.
226
246
installSecret "ods-bitbucket-webhook" \
227
-
"opaque-secret.yaml.tmpl" \
247
+
"${opaqueSecretTemplate}" \
228
248
"${bitbucket_webhook_secret}" \
229
249
""""
230
250
231
251
installSecret "ods-nexus-auth" \
232
-
"basic-auth-secret.yaml.tmpl" \
252
+
"${basicAuthSecretTemplate}" \
233
253
"${nexus_auth}" \
234
254
"Please enter the username of a Nexus user with write permission:" \
235
255
"Please enter the password of this Nexus user (input will be hidden):"
0 commit comments