Skip to content

Commit 79e3da2

Browse files
update to add certs
1 parent a5522e7 commit 79e3da2

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

8.10.x/pipeline.yaml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ spec:
3232
description: "Store your BYOL license key stored as a base64 encoded arbitrary secret in the kube-system namespace. provide the name of the secret here. the defaul is false which means the pipeline will attempt to download a techzone license"
3333
type: string
3434
default: "false"
35+
- name: use-letsencrypt-certs
36+
description: "use generated letsencrypt certs stored as a secret in the openshift-config namespace under letsencrypt-certs, if false, will generate self-signed certs"
37+
type: string
38+
default: "true"
3539
- name: ibm-entitlement-key
3640
description: "IBM entitlement key. If not set, will use secret manager."
3741
type: string
@@ -100,10 +104,6 @@ spec:
100104
- name: set-provided-entitlement-key
101105
workspaces:
102106
- name: ws
103-
#when:
104-
# - input: "$(params.ibm-entitlement-key)"
105-
# operator: notin
106-
# values: ["false"]
107107
params:
108108
- name: provided-entitlement-key
109109
value: "$(params.ibm-entitlement-key)"
@@ -143,7 +143,7 @@ spec:
143143
- name: LICENSE_FILE_SECRET_NAME
144144
steps:
145145
- name: write-maximo-licensefile
146-
image: quay.io/openshift/origin-cli:4.10
146+
image: quay.io/openshift/origin-cli:4.12
147147
script: |
148148
#!/usr/bin/env bash
149149
@@ -165,9 +165,31 @@ spec:
165165
fi
166166
167167
cat $(workspaces.ws.path)/license.dat
168+
- name: get-tls-certs
169+
when:
170+
- input: "$(params.use-letsencrypt-certs)"
171+
operator: in
172+
values: ["true"]
173+
retries: 2
174+
runAfter:
175+
- get-maximo-licensefile
176+
workspaces:
177+
- name: ws
178+
taskSpec:
179+
workspaces:
180+
- name: ws
181+
steps:
182+
- name: get-tls-certs
183+
image: quay.io/openshift/origin-cli:4.12
184+
script: |
185+
mkdir -p $(workspaces.ws.path)/masconfig/certs
186+
wget -qO - https://letsencrypt.org/certs/lets-encrypt-r3.pem > $(workspaces.ws.path)/masconfig/certs/ca.crt
187+
oc get secret letsencrypt-certs -n openshift-config -o jsonpath="{.data['tls\.key']}" | base64 -d > $(workspaces.ws.path)/masconfig/certs/tls.key
188+
oc get secret letsencrypt-certs -n openshift-config -o jsonpath="{.data['tls\.crt']}" | base64 -d > $(workspaces.ws.path)/masconfig/certs/tls.crt
168189
- name: install-mas
169190
retries: 2
170191
runAfter:
192+
- get-tls-certs
171193
- get-maximo-licensefile
172194
workspaces:
173195
- name: ws
@@ -222,6 +244,11 @@ spec:
222244
223245
export ENTITLEMENT_KEY=$(cat $(workspaces.ws.path)/ek.dat)
224246
247+
#this sets things up for manual cert management
248+
# got this via https://github.com/ibm-mas/ansible-devops/pull/501
249+
export MAS_CONFIG_DIR=$(workspaces.ws.path)/masconfig
250+
export MAS_MANUAL_CERT_MGMT=True
251+
225252
#run mas install non-interactively
226253
mas install -i $(params.mas-instance-id) \
227254
-w $(params.mas-workspace-id) \

0 commit comments

Comments
 (0)