From 175b187f694a6679f169723b0fd762c2e759e18b Mon Sep 17 00:00:00 2001 From: roschaefer Date: Mon, 19 Aug 2019 22:33:29 +0200 Subject: [PATCH] Update the COMMIT env var on every deployment This should do the trick: First update the configmap, then trigger a rollout. The new pods should have the update environment variables. --- .../human-connection/templates/configmap.template.yaml | 3 +++ scripts/deploy.sh | 8 +++++--- scripts/patches/patch-configmap.yaml | 7 +++++++ scripts/{ => patches}/patch-deployment.yaml | 0 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 scripts/patches/patch-configmap.yaml rename scripts/{ => patches}/patch-deployment.yaml (100%) diff --git a/deployment/human-connection/templates/configmap.template.yaml b/deployment/human-connection/templates/configmap.template.yaml index 0a7e90343..1bd227af0 100644 --- a/deployment/human-connection/templates/configmap.template.yaml +++ b/deployment/human-connection/templates/configmap.template.yaml @@ -9,6 +9,9 @@ NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687" NEO4J_AUTH: "none" CLIENT_URI: "https://nitro-staging.human-connection.org" + SENTRY_DSN_WEBAPP: "" + SENTRY_DSN_BACKEND: "" + COMMIT: "" metadata: name: configmap namespace: human-connection diff --git a/scripts/deploy.sh b/scripts/deploy.sh index b49fd68a2..cfde8008d 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash -sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patch-deployment.yaml -kubectl --namespace=human-connection patch deployment nitro-backend -p "$(cat $TRAVIS_BUILD_DIR/scripts/patch-deployment.yaml)" -kubectl --namespace=human-connection patch deployment nitro-web -p "$(cat $TRAVIS_BUILD_DIR/scripts/patch-deployment.yaml)" +sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml +sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml +kubectl --namespace=human-connection patch configmap configmap -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml)" +kubectl --namespace=human-connection patch deployment nitro-backend -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" +kubectl --namespace=human-connection patch deployment nitro-web -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" diff --git a/scripts/patches/patch-configmap.yaml b/scripts/patches/patch-configmap.yaml new file mode 100644 index 000000000..7635c01ec --- /dev/null +++ b/scripts/patches/patch-configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +data: + COMMIT: +metadata: + name: configmap + namespace: human-connection diff --git a/scripts/patch-deployment.yaml b/scripts/patches/patch-deployment.yaml similarity index 100% rename from scripts/patch-deployment.yaml rename to scripts/patches/patch-deployment.yaml