Skip to content
Snippets Groups Projects
Commit 92ae53a1 authored by Clement Bois's avatar Clement Bois
Browse files

Merge branch 'fix/gcp-variant' into 'master'

fix(gcp): reduce scope of GCP App Default Creds script to template

Closes #102

See merge request to-be-continuous/python!139
parents 58c404ed 829bfcef
No related branches found
No related tags found
No related merge requests found
...@@ -19,8 +19,7 @@ variables: ...@@ -19,8 +19,7 @@ variables:
GCP_OIDC_ACCOUNT: $[[ inputs.gcp-oidc-account ]] GCP_OIDC_ACCOUNT: $[[ inputs.gcp-oidc-account ]]
GCP_OIDC_PROVIDER: $[[ inputs.gcp-oidc-provider ]] GCP_OIDC_PROVIDER: $[[ inputs.gcp-oidc-provider ]]
.gcp-provider-auth: .python-gcp-adc:
before_script:
- set -e - set -e
- echo -e "[\\e[1;94mINFO\\e[0m] Installing GCP authentication with env GOOGLE_APPLICATION_CREDENTIALS file" - echo -e "[\\e[1;94mINFO\\e[0m] Installing GCP authentication with env GOOGLE_APPLICATION_CREDENTIALS file"
- echo $GCP_JWT > "$CI_BUILDS_DIR/.auth_token.jwt" - echo $GCP_JWT > "$CI_BUILDS_DIR/.auth_token.jwt"
...@@ -39,21 +38,19 @@ variables: ...@@ -39,21 +38,19 @@ variables:
EOF EOF
- export GOOGLE_APPLICATION_CREDENTIALS="$CI_BUILDS_DIR/google_application_credentials.json" - export GOOGLE_APPLICATION_CREDENTIALS="$CI_BUILDS_DIR/google_application_credentials.json"
.python-base: .python-base:
image: $PYTHON_IMAGE image: $PYTHON_IMAGE
services: services:
- name: "$TBC_TRACKING_IMAGE" - name: "$TBC_TRACKING_IMAGE"
command: ["--service", "python", "7.8.1"] command: ["--service", "python", "7.8.1"]
id_tokens:
GCP_JWT:
aud: "$GCP_OIDC_AUD"
variables: variables:
GCP_JWT: $GCP_JWT GCP_JWT: $GCP_JWT
before_script: before_script:
- !reference [.gcp-provider-auth, before_script]
- !reference [.python-scripts] - !reference [.python-scripts]
- !reference [.python-gcp-adc]
- install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}" - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
- cd ${PYTHON_PROJECT_DIR} - cd ${PYTHON_PROJECT_DIR}
- guess_build_system - guess_build_system
id_tokens:
GCP_JWT:
aud: "$GCP_OIDC_AUD"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment