Skip to content

Commit

Permalink
[RW-11491][risk=no] Swap command to service_account parameter (#8714)
Browse files Browse the repository at this point in the history
  • Loading branch information
evrii authored Aug 7, 2024
1 parent 7ed4e58 commit 766f7d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ commands:
oidc_token_file_path:
type: string
default: /home/circleci/oidc_token.json
service_account:
type: string
default: "<< pipeline.parameters.circle-service-account >>"
steps:
- gcp-cli/install
- run:
Expand All @@ -168,7 +171,7 @@ commands:
gcloud iam workload-identity-pools create-cred-config \
"projects/<< parameters.project_id >>/locations/global/workloadIdentityPools/<< parameters.wip_id >>/providers/<< parameters.wip_provider_id >>"\
--output-file="<< pipeline.parameters.circle-service-account-key >>" \
--service-account="<< pipeline.parameters.circle-service-account >>" \
--service-account="<< parameters.service_account >>" \
--credential-source-file=<< parameters.oidc_token_file_path >>
name: Store OIDC credential configuration in temp file
- run:
Expand All @@ -181,7 +184,7 @@ commands:
name: Configure gcloud to use the OIDC credential configuration
- run:
name: Verify that gcloud is authenticated
command: gcloud iam service-accounts get-iam-policy << pipeline.parameters.circle-service-account >>
command: gcloud iam service-accounts get-iam-policy << parameters.service_account >>
- run:
name: Verify that ADC works
command: |
Expand All @@ -203,6 +206,7 @@ commands:
project_id: " 56507752110" # all-of-us-rw-stable
wip_id: "circleci-wip-stable"
wip_provider_id: "circleci-oidc-prv-stable"
service_account: "[email protected]"

gcloud-auth-login-oidc-staging:
description: "Activate CircleCI service account credential for the Staging environment"
Expand Down

0 comments on commit 766f7d7

Please sign in to comment.