-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minor] Support install with manual certificates (#272)
- Loading branch information
Showing
13 changed files
with
174 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
appList=( | ||
"core" | ||
"assist" | ||
"iot" | ||
"manage" | ||
"monitor" | ||
"optimizer" | ||
"predict" | ||
"visualinspection" | ||
) | ||
|
||
if [ -e "/workspace/certificates" ]; then | ||
for app in ${appList[@]}; do | ||
# tls.crt and tls.key will always exist if pipeline is configured to use manual certificates | ||
if [[ -f "/workspace/certificates/$app.tls.crt" ]]; then | ||
echo "Copying certs from $app into configs workspace" | ||
mkdir -p /workspace/configs/certs/$app | ||
cp /workspace/certificates/$app.tls.crt /workspace/configs/certs/$app/tls.crt | ||
cp /workspace/certificates/$app.tls.key /workspace/configs/certs/$app/tls.key | ||
# ca.crt may be empty, but file must exist | ||
if [[ -f "/workspace/certificates/$app.ca.crt" ]]; then | ||
cp /workspace/certificates/$app.ca.crt /workspace/configs/certs/$app/ca.crt | ||
else | ||
touch /workspace/configs/certs/$app/ca.crt | ||
fi | ||
echo "Done" | ||
fi | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- name: suite-certs | ||
params: | ||
{{ lookup('template', 'taskdefs/common/cli-params.yml.j2') | indent(4) }} | ||
- name: devops_suite_name | ||
value: suite-certs | ||
- name: dns_provider | ||
value: $(params.dns_provider) | ||
- name: mas_workspace_id | ||
value: $(params.mas_workspace_id) | ||
- name: mas_manual_cert_mgmt | ||
value: $(params.mas_manual_cert_mgmt) | ||
- name: cis_crn | ||
value: $(params.cis_crn) | ||
- name: cis_apikey | ||
value: $(params.cis_apikey) | ||
- name: cis_subdomain | ||
value: $(params.cis_subdomain) | ||
- name: cis_proxy | ||
value: $(params.cis_proxy) | ||
taskRef: | ||
kind: Task | ||
name: mas-devops-suite-certs | ||
workspaces: | ||
# This is the stage at which we copy across any pre-generated certificates into shared-configs | ||
- name: configs | ||
workspace: shared-configs | ||
- name: certificates | ||
workspace: shared-certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: mas-devops-suite-certs | ||
spec: | ||
params: | ||
- name: dns_provider | ||
type: string | ||
default: "" | ||
- name: mas_instance_id | ||
type: string | ||
- name: mas_workspace_id | ||
type: string | ||
default: "" | ||
- name: mas_manual_cert_mgmt | ||
type: string | ||
description: Optional boolean parameter that when set to True, indicates that manually created certificates will be used to certify MAS and application routes | ||
default: "" | ||
|
||
# IBM Cloud Internet Services support | ||
- name: cis_crn | ||
type: string | ||
default: "" | ||
- name: cis_apikey | ||
type: string | ||
default: "" | ||
- name: cis_subdomain | ||
type: string | ||
default: "" | ||
- name: cis_proxy | ||
type: string | ||
default: "" | ||
|
||
# Optional support built into the ansible-devops image | ||
# for saving task execution results to a MongoDb instance | ||
- name: devops_suite_name | ||
type: string | ||
description: Optional name for the junit suite, used to enable save-junit-to-mongo.py | ||
default: "" | ||
|
||
stepTemplate: | ||
env: | ||
{{ lookup('template', task_src_dir ~ '/common/cli-env.yml.j2') | indent(6) }} | ||
# General | ||
- name: MAS_CONFIG_DIR | ||
value: /workspace/configs | ||
- name: DNS_PROVIDER | ||
value: $(params.dns_provider) | ||
- name: MAS_INSTANCE_ID | ||
value: $(params.mas_instance_id) | ||
- name: MAS_WORKSPACE_ID | ||
value: $(params.mas_workspace_id) | ||
- name: MAS_MANUAL_CERT_MGMT | ||
value: $(params.mas_manual_cert_mgmt) | ||
- name: CIS_CRN | ||
value: $(params.cis_crn) | ||
- name: CIS_APIKEY | ||
value: $(params.cis_apikey) | ||
- name: CIS_SUBDOMAIN | ||
value: $(params.cis_subdomain) | ||
- name: CIS_PROXY | ||
value: $(params.cis_proxy) | ||
- name: DEVOPS_SUITE_NAME | ||
value: $(params.devops_suite_name) | ||
|
||
steps: | ||
- name: suite-certs | ||
command: | ||
- /opt/app-root/src/run-role.sh | ||
- suite_certs | ||
image: quay.io/ibmmas/cli:latest | ||
imagePullPolicy: $(params.image_pull_policy) | ||
|
||
workspaces: | ||
- name: configs | ||
- name: certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters