diff options
author | walkafwalka <aaron.walker@goldenhippo.com> | 2019-01-18 05:16:11 +0300 |
---|---|---|
committer | walkafwalka <aaron.walker@goldenhippo.com> | 2019-01-18 22:46:26 +0300 |
commit | 1b3c6e0e451d8ef7a6d60f2d13e31d8bbcbdb444 (patch) | |
tree | 63bcd0ba3e06b98b8daa7fc304087975d1034f99 /lib | |
parent | b9494bf302e6b13fed230bec598c427a32f05ff7 (diff) |
Force Auto DevOps redeployment when application secrets are updated
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml index 95160e1432f..d2a1f944c56 100644 --- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml @@ -621,6 +621,12 @@ rollout 100%: --from-env-file <(k8s_prefixed_variables) -o yaml --dry-run | kubectl replace -n "$KUBE_NAMESPACE" --force -f - ' + + function k8s_prefixed_variables() { + env | sed -n "s/^K8S_SECRET_\(.*\)$/\1/p" + } + + APPLICATION_SECRET_CHECKSUM=$(k8s_prefixed_variables | sha256sum | cut -d ' ' -f 1) } function deploy_name() { @@ -688,6 +694,7 @@ rollout 100%: --set application.track="$track" \ --set application.database_url="$DATABASE_URL" \ --set application.secretName="$APPLICATION_SECRET_NAME" \ + --set application.secretChecksum="$APPLICATION_SECRET_CHECKSUM" \ --set service.url="$CI_ENVIRONMENT_URL" \ --set service.additionalHosts="$additional_hosts" \ --set replicaCount="$replicas" \ @@ -722,6 +729,7 @@ rollout 100%: --set application.track="$track" \ --set application.database_url="$DATABASE_URL" \ --set application.secretName="$APPLICATION_SECRET_NAME" \ + --set application.secretChecksum="$APPLICATION_SECRET_CHECKSUM" \ --set service.url="$CI_ENVIRONMENT_URL" \ --set service.additionalHosts="$additional_hosts" \ --set replicaCount="$replicas" \ |