From 2b5585d4e9e2758745c05bc922e5263ac5c58886 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Mon, 2 Jun 2025 12:53:06 -0400 Subject: [PATCH 01/13] Updated circleci config to push to gar --- .circleci/config.yml | 43 +++++++++++++++++++++++++++++++++++++++ scripts/store_git_info.sh | 3 +++ 2 files changed, 46 insertions(+) create mode 100644 scripts/store_git_info.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 6daa37f..b18d1f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,6 +60,12 @@ workflows: only: - master - production + build: + jobs: + - deploy_gar: + name: Deploy Profiler to GAR + context: + - gcpv2-workload-identity # This is a weekly workflow, just to deploy new versions of the docker images, # so that updates to the underlying images are used and deployed. @@ -187,3 +193,40 @@ jobs: echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin docker push $IMAGE_NAME:$IMAGE_LATEST_TAG docker push $IMAGE_NAME:$IMAGE_VERSION_TAG + deploy_gar: + machine: + image: ubuntu-2004:2023.10.1 + docker_layer_caching: true + steps: + - checkout + - run: + name: Prepare environment variables for OIDC authentication + command: | + echo 'export GOOGLE_PROJECT_ID="moz-fx-profiler-prod"' >> "$BASH_ENV" + echo "export OIDC_WIP_ID=$GCPV2_WORKLOAD_IDENTITY_POOL_ID" >> "$BASH_ENV" + echo "export OIDC_WIP_PROVIDER_ID=$GCPV2_CIRCLECI_WORKLOAD_IDENTITY_PROVIDER" >> "$BASH_ENV" + echo "export GOOGLE_PROJECT_NUMBER=$GCPV2_WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER" >> "$BASH_ENV" + echo "export OIDC_SERVICE_ACCOUNT_EMAIL=$GCP_SERVICE_ACCOUNT_EMAIL" >> "$BASH_ENV" + - gcp-cli/setup: + use_oidc: true + - run: + name: Deploy to Google Artifact Registry + command: | + ./scripts/store_git_info.sh + make build_prod + gcloud auth configure-docker us-docker.pkg.dev --quiet + + DOCKER_IMAGE="us-docker.pkg.dev/moz-fx-profiler-prod/profiler-prod/firefoxprofiler" + IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" + IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" + + docker tag profiler-server:dev ${DOCKER_IMAGE}:$IMAGE_LATEST_TAG + docker tag profiler-server:deploy ${DOCKER_IMAGE}:$IMAGE_VERSION_TAG + + docker push "${DOCKER_IMAGE}:IMAGE_LATEST_TAG" + docker push "${DOCKER_IMAGE}:IMAGE_VERSION_TAG" + + + GIT_SHA=$(git rev-parse --short HEAD) + docker tag profiler-server:deploy ${DOCKER_IMAGE}:sha-${GIT_SHA} + docker push ${DOCKER_IMAGE}:sha-${GIT_SHA} diff --git a/scripts/store_git_info.sh b/scripts/store_git_info.sh new file mode 100644 index 0000000..7b760dc --- /dev/null +++ b/scripts/store_git_info.sh @@ -0,0 +1,3 @@ +# version.json generated from ./bin/generate-version-file.js +git log -n 1 --no-color --pretty='%s' > ./commit-summary.txt +git log -n 1 --no-color --pretty=medium > ./commit-description.txt From 0e56d85b859416eac57ef8cad633a3a4c7acbea1 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Tue, 3 Jun 2025 10:28:00 -0400 Subject: [PATCH 02/13] Updated circleci config --- .circleci/config.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b18d1f0..14be476 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,10 +60,15 @@ workflows: only: - master - production - build: - jobs: - - deploy_gar: - name: Deploy Profiler to GAR + - deploy-gar: + name: Deploy to GAR + requires: + - docker + filters: + branches: + only: + - master + - production context: - gcpv2-workload-identity @@ -193,7 +198,7 @@ jobs: echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin docker push $IMAGE_NAME:$IMAGE_LATEST_TAG docker push $IMAGE_NAME:$IMAGE_VERSION_TAG - deploy_gar: + deploy-gar: machine: image: ubuntu-2004:2023.10.1 docker_layer_caching: true From 936bc4788644d8db7d79358791c0da846aff7b68 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Tue, 3 Jun 2025 10:33:50 -0400 Subject: [PATCH 03/13] Removed shell and make commands, further updates to the config --- .circleci/config.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 14be476..078f158 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -199,9 +199,14 @@ jobs: docker push $IMAGE_NAME:$IMAGE_LATEST_TAG docker push $IMAGE_NAME:$IMAGE_VERSION_TAG deploy-gar: - machine: - image: ubuntu-2004:2023.10.1 - docker_layer_caching: true + executor: gcp-gcr/default + parameters: + image: + type: string + default: us-docker.pkg.dev/moz-fx-profiler-prod/profiler-prod/firefoxprofiler + tag: + type: string + default: latest steps: - checkout - run: @@ -217,8 +222,6 @@ jobs: - run: name: Deploy to Google Artifact Registry command: | - ./scripts/store_git_info.sh - make build_prod gcloud auth configure-docker us-docker.pkg.dev --quiet DOCKER_IMAGE="us-docker.pkg.dev/moz-fx-profiler-prod/profiler-prod/firefoxprofiler" From cb5dc13e43598ed42c3898d6feb5c0a2cc1c3750 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Tue, 3 Jun 2025 16:17:27 -0400 Subject: [PATCH 04/13] Updated circleconfig- following autopush --- .circleci/config.yml | 80 ++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 078f158..4c13bb2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,9 +69,6 @@ workflows: only: - master - production - context: - - gcpv2-workload-identity - # This is a weekly workflow, just to deploy new versions of the docker images, # so that updates to the underlying images are used and deployed. # This is configured to run on Thursdays (4th day in the week, Sunday is 0). @@ -201,40 +198,57 @@ jobs: deploy-gar: executor: gcp-gcr/default parameters: + build_tag: + type: string + default: build image: type: string - default: us-docker.pkg.dev/moz-fx-profiler-prod/profiler-prod/firefoxprofiler - tag: + default: firefoxprofiler + registry-url: type: string - default: latest + default: us-docker.pkg.dev steps: - - checkout - - run: - name: Prepare environment variables for OIDC authentication - command: | - echo 'export GOOGLE_PROJECT_ID="moz-fx-profiler-prod"' >> "$BASH_ENV" - echo "export OIDC_WIP_ID=$GCPV2_WORKLOAD_IDENTITY_POOL_ID" >> "$BASH_ENV" - echo "export OIDC_WIP_PROVIDER_ID=$GCPV2_CIRCLECI_WORKLOAD_IDENTITY_PROVIDER" >> "$BASH_ENV" - echo "export GOOGLE_PROJECT_NUMBER=$GCPV2_WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER" >> "$BASH_ENV" - echo "export OIDC_SERVICE_ACCOUNT_EMAIL=$GCP_SERVICE_ACCOUNT_EMAIL" >> "$BASH_ENV" - - gcp-cli/setup: + # gcr-auth parameters: + # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-gcr-auth + - gcp-gcr/gcr-auth: + gcp_cred_config_file_path: ~/gcp_cred_config.json + google-project-id: GCP_GAR_PROJECT_ID + google_project_number: GCP_OIDC_PROJECT_NUMBER + registry-url: <> + service_account_email: GCP_OIDC_SERVICE_ACCOUNT_EMAIL use_oidc: true + workload_identity_pool_id: GCP_OIDC_WIP_ID + workload_identity_pool_provider_id: GCP_OIDC_WIP_PROVIDER_ID + - attach_workspace: + at: /tmp/cache + - run: + name: Restore Docker image cache + command: docker load -i /tmp/cache/<>.tar + # This is the easiest way to tag multiple images using different + # conditions for the GAR_TAG variable in the smallest amount of code. + # + # You can find other jobs and commands you can use with this orb that + # include tagging here: + # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr - run: - name: Deploy to Google Artifact Registry + name: Tag image command: | - gcloud auth configure-docker us-docker.pkg.dev --quiet - - DOCKER_IMAGE="us-docker.pkg.dev/moz-fx-profiler-prod/profiler-prod/firefoxprofiler" - IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" - IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" - - docker tag profiler-server:dev ${DOCKER_IMAGE}:$IMAGE_LATEST_TAG - docker tag profiler-server:deploy ${DOCKER_IMAGE}:$IMAGE_VERSION_TAG - - docker push "${DOCKER_IMAGE}:IMAGE_LATEST_TAG" - docker push "${DOCKER_IMAGE}:IMAGE_VERSION_TAG" - - - GIT_SHA=$(git rev-parse --short HEAD) - docker tag profiler-server:deploy ${DOCKER_IMAGE}:sha-${GIT_SHA} - docker push ${DOCKER_IMAGE}:sha-${GIT_SHA} + if [ ! -z "${CIRCLE_TAG}" ]; then + echo "export GAR_TAG=${CIRCLE_TAG}" >> $BASH_ENV + else + echo "export GAR_TAG=${CIRCLE_BRANCH}" >> $BASH_ENV + fi + echo "export GAR_IMAGE=\"<>/${GCP_GAR_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV + source $BASH_ENV + IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" + IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" + + docker tag <> $GAR_IMAGE:$IMAGE_VERSION_TAG + docker tag <> $GAR_IMAGE:$IMAGE_LATEST_TAG + # push-image parameters: + # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image + - gcp-gcr/push-image: + image: "${GCP_GAR_REPO}/<>" + google-project-id: GCP_GAR_PROJECT_ID + registry-url: <> + tag: $IMAGE_VERSION_TAG,$IMAGE_VERSION_TAG From c1cbf0f0037c4b56e5742f306940ddd7e86c31b6 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Tue, 3 Jun 2025 16:19:57 -0400 Subject: [PATCH 05/13] Updated orbs with gcp-cli and gcp-gcr --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c13bb2..0538f6f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,8 @@ executors: orbs: shellcheck: circleci/shellcheck@3.0.0 + gcp-cli: circleci/gcp-cli@3.3.0 + gcp-gcr: circleci/gcp-gcr@0.16.3 commands: checkout-and-dependencies: From fad6870951cb37975d22c50120c3a68530a26da1 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Tue, 3 Jun 2025 17:01:06 -0400 Subject: [PATCH 06/13] Removed the scripts folder. Older change, not needed --- .circleci/config.yml | 3 +-- scripts/store_git_info.sh | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 scripts/store_git_info.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 0538f6f..37f02d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,8 +62,7 @@ workflows: only: - master - production - - deploy-gar: - name: Deploy to GAR + - deploy-gar: requires: - docker filters: diff --git a/scripts/store_git_info.sh b/scripts/store_git_info.sh deleted file mode 100644 index 7b760dc..0000000 --- a/scripts/store_git_info.sh +++ /dev/null @@ -1,3 +0,0 @@ -# version.json generated from ./bin/generate-version-file.js -git log -n 1 --no-color --pretty='%s' > ./commit-summary.txt -git log -n 1 --no-color --pretty=medium > ./commit-description.txt From 84693747e7be203a2998b2de56e4d8444e6ae6eb Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Wed, 4 Jun 2025 11:38:10 -0400 Subject: [PATCH 07/13] Including changes to env vars using our gcpv2 context --- .circleci/config.yml | 70 +++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37f02d8..639dee6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,6 @@ executors: orbs: shellcheck: circleci/shellcheck@3.0.0 gcp-cli: circleci/gcp-cli@3.3.0 - gcp-gcr: circleci/gcp-gcr@0.16.3 commands: checkout-and-dependencies: @@ -62,7 +61,9 @@ workflows: only: - master - production - - deploy-gar: + - deploy-gar: + context: + - gcpv2-workload-identity requires: - docker filters: @@ -209,47 +210,30 @@ jobs: type: string default: us-docker.pkg.dev steps: - # gcr-auth parameters: - # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-gcr-auth - - gcp-gcr/gcr-auth: - gcp_cred_config_file_path: ~/gcp_cred_config.json - google-project-id: GCP_GAR_PROJECT_ID - google_project_number: GCP_OIDC_PROJECT_NUMBER - registry-url: <> - service_account_email: GCP_OIDC_SERVICE_ACCOUNT_EMAIL - use_oidc: true - workload_identity_pool_id: GCP_OIDC_WIP_ID - workload_identity_pool_provider_id: GCP_OIDC_WIP_PROVIDER_ID - - attach_workspace: - at: /tmp/cache + - checkout - run: - name: Restore Docker image cache - command: docker load -i /tmp/cache/<>.tar - # This is the easiest way to tag multiple images using different - # conditions for the GAR_TAG variable in the smallest amount of code. - # - # You can find other jobs and commands you can use with this orb that - # include tagging here: - # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr + name: Prepare environment variables for OIDC authentication + command: | + echo 'export GOOGLE_PROJECT_ID="moz-fx-profiler-prod"' >> "$BASH_ENV" + echo "export OIDC_WIP_ID=$GCPV2_WORKLOAD_IDENTITY_POOL_ID" >> "$BASH_ENV" + echo "export OIDC_WIP_PROVIDER_ID=$GCPV2_CIRCLECI_WORKLOAD_IDENTITY_PROVIDER" >> "$BASH_ENV" + echo "export GOOGLE_PROJECT_NUMBER=$GCPV2_WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER" >> "$BASH_ENV" + echo "export OIDC_SERVICE_ACCOUNT_EMAIL=$GCP_SERVICE_ACCOUNT_EMAIL" >> "$BASH_ENV" + echo 'export GCP_GAR_REPO="profiler-prod"' >> "$BASH_ENV" + echo "export GAR_IMAGE=\"<>/${GOOGLE_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV + - gcp-cli/setup: + use_oidc: true - run: - name: Tag image + name: Deploy to Google Artifact Registry command: | - if [ ! -z "${CIRCLE_TAG}" ]; then - echo "export GAR_TAG=${CIRCLE_TAG}" >> $BASH_ENV - else - echo "export GAR_TAG=${CIRCLE_BRANCH}" >> $BASH_ENV - fi - echo "export GAR_IMAGE=\"<>/${GCP_GAR_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV - source $BASH_ENV - IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" - IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" - - docker tag <> $GAR_IMAGE:$IMAGE_VERSION_TAG - docker tag <> $GAR_IMAGE:$IMAGE_LATEST_TAG - # push-image parameters: - # https://circleci.com/developer/orbs/orb/circleci/gcp-gcr#commands-push-image - - gcp-gcr/push-image: - image: "${GCP_GAR_REPO}/<>" - google-project-id: GCP_GAR_PROJECT_ID - registry-url: <> - tag: $IMAGE_VERSION_TAG,$IMAGE_VERSION_TAG + gcloud auth configure-docker us-docker.pkg.dev --quiet + + source $BASH_ENV + IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" + IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" + + docker tag <> $GAR_IMAGE:$IMAGE_VERSION_TAG + docker tag <> $GAR_IMAGE:$IMAGE_LATEST_TAG + + docker push $GAR_IMAGE:$IMAGE_VERSION_TAG + docker push $GAR_IMAGE:$IMAGE_LATEST_TAG \ No newline at end of file From 765acd52c28c419ef2ba288601224417b9532861 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Wed, 4 Jun 2025 11:41:14 -0400 Subject: [PATCH 08/13] Restoring gcp-gcr orb --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 639dee6..f03cac3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,7 @@ executors: orbs: shellcheck: circleci/shellcheck@3.0.0 gcp-cli: circleci/gcp-cli@3.3.0 + gcp-gcr: circleci/gcp-gcr@0.16.3 commands: checkout-and-dependencies: From 87ad71cd071fe82ffb700b01ac7dfeaccc4df7ed Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Wed, 4 Jun 2025 11:59:56 -0400 Subject: [PATCH 09/13] Removed docker requirement from deploy-gar --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f03cac3..6be2c85 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,8 +65,6 @@ workflows: - deploy-gar: context: - gcpv2-workload-identity - requires: - - docker filters: branches: only: From 48ebec263ec8145f38f186705d7297a4a4f958c0 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Wed, 4 Jun 2025 15:12:05 -0400 Subject: [PATCH 10/13] Ran yarn prettier-run to resolve lint --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6be2c85..3ca5242 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,12 +64,12 @@ workflows: - production - deploy-gar: context: - - gcpv2-workload-identity + - gcpv2-workload-identity filters: branches: only: - master - - production + - production # This is a weekly workflow, just to deploy new versions of the docker images, # so that updates to the underlying images are used and deployed. # This is configured to run on Thursdays (4th day in the week, Sunday is 0). @@ -230,9 +230,9 @@ jobs: source $BASH_ENV IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" - + docker tag <> $GAR_IMAGE:$IMAGE_VERSION_TAG docker tag <> $GAR_IMAGE:$IMAGE_LATEST_TAG - + docker push $GAR_IMAGE:$IMAGE_VERSION_TAG - docker push $GAR_IMAGE:$IMAGE_LATEST_TAG \ No newline at end of file + docker push $GAR_IMAGE:$IMAGE_LATEST_TAG From 119ae60b9857fe2744f6cdbaa79b1c2718bd4b80 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Wed, 4 Jun 2025 15:27:55 -0400 Subject: [PATCH 11/13] Revert "Ran yarn prettier-run to resolve lint" This reverts commit 48ebec263ec8145f38f186705d7297a4a4f958c0. --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ca5242..6be2c85 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,12 +64,12 @@ workflows: - production - deploy-gar: context: - - gcpv2-workload-identity + - gcpv2-workload-identity filters: branches: only: - master - - production + - production # This is a weekly workflow, just to deploy new versions of the docker images, # so that updates to the underlying images are used and deployed. # This is configured to run on Thursdays (4th day in the week, Sunday is 0). @@ -230,9 +230,9 @@ jobs: source $BASH_ENV IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" - + docker tag <> $GAR_IMAGE:$IMAGE_VERSION_TAG docker tag <> $GAR_IMAGE:$IMAGE_LATEST_TAG - + docker push $GAR_IMAGE:$IMAGE_VERSION_TAG - docker push $GAR_IMAGE:$IMAGE_LATEST_TAG + docker push $GAR_IMAGE:$IMAGE_LATEST_TAG \ No newline at end of file From 00a940e12eaf4c4b144002bcd7d7a342101910f3 Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Wed, 4 Jun 2025 15:28:52 -0400 Subject: [PATCH 12/13] Ran yarn prettier-run to resolve lint --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6be2c85..3ca5242 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,12 +64,12 @@ workflows: - production - deploy-gar: context: - - gcpv2-workload-identity + - gcpv2-workload-identity filters: branches: only: - master - - production + - production # This is a weekly workflow, just to deploy new versions of the docker images, # so that updates to the underlying images are used and deployed. # This is configured to run on Thursdays (4th day in the week, Sunday is 0). @@ -230,9 +230,9 @@ jobs: source $BASH_ENV IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest" - + docker tag <> $GAR_IMAGE:$IMAGE_VERSION_TAG docker tag <> $GAR_IMAGE:$IMAGE_LATEST_TAG - + docker push $GAR_IMAGE:$IMAGE_VERSION_TAG - docker push $GAR_IMAGE:$IMAGE_LATEST_TAG \ No newline at end of file + docker push $GAR_IMAGE:$IMAGE_LATEST_TAG From 53fb56a8269e414615e045abbb7c8064cc28af9b Mon Sep 17 00:00:00 2001 From: Brandon Wells Date: Thu, 5 Jun 2025 12:44:04 -0400 Subject: [PATCH 13/13] Resolving PR comments --- .circleci/config.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ca5242..a99df8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,13 +63,15 @@ workflows: - master - production - deploy-gar: + requires: + - docker context: - gcpv2-workload-identity - filters: - branches: - only: - - master - - production + # filters: + # branches: + # only: + # - master + # - production # This is a weekly workflow, just to deploy new versions of the docker images, # so that updates to the underlying images are used and deployed. # This is configured to run on Thursdays (4th day in the week, Sunday is 0). @@ -210,8 +212,10 @@ jobs: default: us-docker.pkg.dev steps: - checkout + - gcp-cli/setup: + use_oidc: true - run: - name: Prepare environment variables for OIDC authentication + name: Prepare environment variables for OIDC authentication and Deploy to Google Artifact Registry command: | echo 'export GOOGLE_PROJECT_ID="moz-fx-profiler-prod"' >> "$BASH_ENV" echo "export OIDC_WIP_ID=$GCPV2_WORKLOAD_IDENTITY_POOL_ID" >> "$BASH_ENV" @@ -220,14 +224,9 @@ jobs: echo "export OIDC_SERVICE_ACCOUNT_EMAIL=$GCP_SERVICE_ACCOUNT_EMAIL" >> "$BASH_ENV" echo 'export GCP_GAR_REPO="profiler-prod"' >> "$BASH_ENV" echo "export GAR_IMAGE=\"<>/${GOOGLE_PROJECT_ID}/${GCP_GAR_REPO}/<>\"" >> $BASH_ENV - - gcp-cli/setup: - use_oidc: true - - run: - name: Deploy to Google Artifact Registry - command: | + gcloud auth configure-docker us-docker.pkg.dev --quiet - source $BASH_ENV IMAGE_VERSION_TAG="0.0.${CIRCLE_BUILD_NUM}" IMAGE_LATEST_TAG="${CIRCLE_BRANCH}-latest"