From 2ff3b377c78d4554aee6fbc96b4ae4f5985e55f2 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Mon, 19 Aug 2024 12:14:09 -0700 Subject: [PATCH 1/4] set env var for sops to use for auth --- .github/workflows/deploy-to-staging.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-to-staging.yaml b/.github/workflows/deploy-to-staging.yaml index f5f373eca..a31c36d03 100644 --- a/.github/workflows/deploy-to-staging.yaml +++ b/.github/workflows/deploy-to-staging.yaml @@ -78,6 +78,7 @@ jobs: - name: Deploy hubs to staging if: ${{ env.DEPLOY }} run: | + GOOGLE_APPLICATION_CREDENTIALS=${{ secrets.GKE_KEY }} for hub in $(echo -e "${{ env.DEPLOY_HUBS }}"); do echo "Deploying $hub to staging" hubploy --verbose deploy $hub hub staging From 14ac6e24f0af139aae8a84b28aa2ef2cbf231288 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Mon, 19 Aug 2024 13:00:50 -0700 Subject: [PATCH 2/4] update variable name to match secret in github repo --- .github/workflows/deploy-to-staging.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-staging.yaml b/.github/workflows/deploy-to-staging.yaml index a31c36d03..d3726026a 100644 --- a/.github/workflows/deploy-to-staging.yaml +++ b/.github/workflows/deploy-to-staging.yaml @@ -78,7 +78,7 @@ jobs: - name: Deploy hubs to staging if: ${{ env.DEPLOY }} run: | - GOOGLE_APPLICATION_CREDENTIALS=${{ secrets.GKE_KEY }} + GOOGLE_APPLICATION_CREDENTIALS=${{ secrets.SOPS_KEY }} for hub in $(echo -e "${{ env.DEPLOY_HUBS }}"); do echo "Deploying $hub to staging" hubploy --verbose deploy $hub hub staging From f5959277709451bd0da0385dda2174b22f55c36a Mon Sep 17 00:00:00 2001 From: shane knapp Date: Mon, 19 Aug 2024 13:02:24 -0700 Subject: [PATCH 3/4] trigger a deployment to staging --- deployments/logodev/hubploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/logodev/hubploy.yaml b/deployments/logodev/hubploy.yaml index 28ea5c8da..f6a83f0fd 100644 --- a/deployments/logodev/hubploy.yaml +++ b/deployments/logodev/hubploy.yaml @@ -1,7 +1,7 @@ images: images: # temporary update - - name: us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/logodev-user-image:71e05556317f + - name: us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/logodev-user-image:a9443779a3a9 cluster: provider: gcloud From 8b1addc55fd3b0d7a7da25ae9946412be6dcd4a8 Mon Sep 17 00:00:00 2001 From: shane knapp Date: Mon, 19 Aug 2024 13:14:20 -0700 Subject: [PATCH 4/4] remove repo from paths etc --- .github/workflows/deploy-to-staging.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-to-staging.yaml b/.github/workflows/deploy-to-staging.yaml index d3726026a..b2ef46eab 100644 --- a/.github/workflows/deploy-to-staging.yaml +++ b/.github/workflows/deploy-to-staging.yaml @@ -62,10 +62,10 @@ jobs: - name: Install SOPS if: ${{ env.DEPLOY }} run: | - mkdir -p ${HOME}/repo/bin - curl -sSL https://github.com/mozilla/sops/releases/download/v3.7.0/sops-v3.7.0.linux -o ${HOME}/repo/bin/sops - chmod 755 ${HOME}/repo/bin/sops - echo "${HOME}/repo/bin" >> $GITHUB_PATH + mkdir -p ${HOME}/bin + curl -sSL https://github.com/mozilla/sops/releases/download/v3.7.0/sops-v3.7.0.linux -o ${HOME}/bin/sops + chmod 755 ${HOME}/bin/sops + echo "${HOME}/bin" >> $GITHUB_PATH - name: Install Helm if: ${{ env.DEPLOY }} @@ -78,7 +78,8 @@ jobs: - name: Deploy hubs to staging if: ${{ env.DEPLOY }} run: | - GOOGLE_APPLICATION_CREDENTIALS=${{ secrets.SOPS_KEY }} + echo ${{ secrets.SOPS_KEY }} > ${HOME}/sops.key + export GOOGLE_APPLICATION_CREDENTIALS="${HOME}/sops.key" for hub in $(echo -e "${{ env.DEPLOY_HUBS }}"); do echo "Deploying $hub to staging" hubploy --verbose deploy $hub hub staging