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.
This commit is contained in:
roschaefer 2019-08-19 22:33:29 +02:00
parent 07a90b8865
commit 175b187f69
4 changed files with 15 additions and 3 deletions

View File

@ -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

View File

@ -1,4 +1,6 @@
#!/usr/bin/env bash
sed -i "s/<COMMIT>/${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/<COMMIT>/${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml
sed -i "s/<COMMIT>/${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)"

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
data:
COMMIT: <COMMIT>
metadata:
name: configmap
namespace: human-connection