Skip to content

Commit

Permalink
Merge pull request #2900 from uselagoon/lagoon-yaml-configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood authored Nov 2, 2021
2 parents cfc051c + bd5b075 commit c1b2c4f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ if kubectl --insecure-skip-tls-verify -n ${NAMESPACE} get configmap lagoon-yaml
# if the environment has already been deployed with an existing configmap that had the file in the key `.lagoon.yml`
# just nuke the entire configmap and replace it with our new key and file
LAGOON_YML_CM=$(kubectl --insecure-skip-tls-verify -n ${NAMESPACE} get configmap lagoon-yaml -o json)
if [ $(echo ${LAGOON_YML_CM} | jq -r '.data.".lagoon.yml" // false') == false ]; then
if [ "$(echo ${LAGOON_YML_CM} | jq -r '.data.".lagoon.yml" // false')" == "false" ]; then
# if the key doesn't exist, then just update the pre-deploy yaml only
kubectl --insecure-skip-tls-verify -n ${NAMESPACE} get configmap lagoon-yaml -o json | jq --arg add "`cat .lagoon.yml`" '.data."pre-deploy" = $add' | kubectl apply -f -
else
# if the key does exist, then nuke it and put the new key
kubectl --insecure-skip-tls-verify -n ${NAMESPACE} create configmap lagoon-yaml --from-file=pre-deploy=.lagoon.yml -o yaml --dry-run | kubectl replace -f -
kubectl --insecure-skip-tls-verify -n ${NAMESPACE} create configmap lagoon-yaml --from-file=pre-deploy=.lagoon.yml -o yaml --dry-run=client | kubectl replace -f -
fi
else
# create it
Expand Down Expand Up @@ -1615,7 +1615,7 @@ LAGOON_AUTOGENERATED_ROUTES=${AUTOGENERATED_ROUTES}\n\
" >> /kubectl-build-deploy/values.env

# Generate a Config Map with project wide env variables
kubectl -n ${NAMESPACE} create configmap lagoon-env -o yaml --dry-run --from-env-file=/kubectl-build-deploy/values.env | kubectl apply -n ${NAMESPACE} -f -
kubectl -n ${NAMESPACE} create configmap lagoon-env -o yaml --dry-run=client --from-env-file=/kubectl-build-deploy/values.env | kubectl apply -n ${NAMESPACE} -f -

set +x # reduce noise in build logs
# Add environment variables from lagoon API
Expand Down

0 comments on commit c1b2c4f

Please sign in to comment.