Skip to content

Commit

Permalink
Fixes from being able to actually test this workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sjahl committed Nov 18, 2024
1 parent 69800da commit bd21e9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .cloudbuild/bluegreen-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ done
# Retrieve current active blue/green and verify that it matches what's currently defined in git
####

gcloud container clusters get-credentials --zone $CLOUDSDK_COMPUTE_ZONE $CLOUDSDK_CONTAINER_CLUSTER
gcloud container clusters get-credentials --dns-endpoint --zone $CLOUDSDK_COMPUTE_ZONE $CLOUDSDK_CONTAINER_CLUSTER

CURRENT_DEPLOYMENT=$(kubectl get service gnomad-browser-bluegreen -o jsonpath='{.spec.selector.deployment}')

Expand Down Expand Up @@ -57,7 +57,7 @@ echo "target/inactive deployment is $TARGET_DEPLOYMENT"
####
pushd $TARGET_DEPLOYMENT
kustomize --stack-trace edit set image "gnomad-api=us-docker.pkg.dev/${REPO_PROJECT}/gnomad/gnomad-api:${DOCKER_TAG}"
kustomize --stack-trace edit set image "gnomad-browser-us-docker.pkg.dev/${REPO_PROJECT}/gnomad/gnomad-browser:${DOCKER_TAG}"
kustomize --stack-trace edit set image "gnomad-browser=us-docker.pkg.dev/${REPO_PROJECT}/gnomad/gnomad-browser:${DOCKER_TAG}"
popd

git add $TARGET_DEPLOYMENT
Expand Down
12 changes: 11 additions & 1 deletion .cloudbuild/rev-browser-bluegreen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
steps:
- name: 'ubuntu'
entrypoint: 'bash'
args:
- -c
- |
echo $$GNOMAD_BUILD_ENV > browser/build.env
secretEnv:
- 'GNOMAD_BUILD_ENV'
- name: 'gcr.io/cloud-builders/docker'
args:
[
Expand Down Expand Up @@ -33,7 +41,7 @@ steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-browser:${_BUILD_TAG}']

- name: 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/tgg-deploykit:1.0.0'
- name: 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/tgg-deploykit:testing-4'
entrypoint: 'bash'
args: ['./bluegreen-update.sh']
dir: '.cloudbuild'
Expand All @@ -48,6 +56,8 @@ availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/GITHUB_DEPLOY_KEY/versions/latest
env: 'DEPLOY_KEY'
- versionName: projects/$PROJECT_ID/secrets/GNOMAD_BUILD_ENV/versions/1
env: 'GNOMAD_BUILD_ENV'
options:
dynamicSubstitutions: true
substitutions:
Expand Down

0 comments on commit bd21e9f

Please sign in to comment.