From 07b4fed5627de76e8acd9500877b954970266059 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 4 Dec 2020 11:20:29 +1100 Subject: [PATCH] push the lagoon.yml file into a configmap in the environment namespace --- .../build-deploy-docker-compose.sh | 12 ++++++++++++ .../build-deploy-docker-compose.sh | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh index 7414c60507..4175e0a63d 100755 --- a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh @@ -1322,3 +1322,15 @@ if [ "${LAGOON_POSTROLLOUT_DISABLED}" != "true" ]; then else echo "post-rollout tasks are currently disabled LAGOON_POSTROLLOUT_DISABLED is set to true" fi + +############################################## +### PUSH the latest .lagoon.yml into lagoon-yaml configmap +############################################## + +if kubectl --insecure-skip-tls-verify -n ${NAMESPACE} get configmap lagoon-yaml &> /dev/null; then + # replace it + kubectl --insecure-skip-tls-verify -n ${NAMESPACE} create configmap lagoon-yaml --from-file=.lagoon.yml -o yaml --dry-run | kubectl replace -f - +else + # create it + kubectl --insecure-skip-tls-verify -n ${NAMESPACE} create configmap lagoon-yaml --from-file=.lagoon.yml +fi diff --git a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh index 039e4f1699..fae3a41542 100755 --- a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh @@ -1335,3 +1335,15 @@ if [ "${LAGOON_POSTROLLOUT_DISABLED}" != "true" ]; then else echo "post-rollout tasks are currently disabled LAGOON_POSTROLLOUT_DISABLED is set to true" fi + +############################################## +### PUSH the latest .lagoon.yml into lagoon-yaml configmap +############################################## + +if oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} get configmap lagoon-yaml &> /dev/null; then + # replace it + oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} create configmap lagoon-yaml --from-file=.lagoon.yml -o yaml --dry-run | oc replace -f - +else + # create it + oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} create configmap lagoon-yaml --from-file=.lagoon.yml +fi