Skip to content

chore: add Cloud SQL samples env vars as secrets #13065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .kokoro/tests/run_tests.sh
Original file line number Diff line number Diff line change
@@ -108,16 +108,18 @@ fi
# On kokoro, we should be able to use the default service account. We
# need to somehow bootstrap the secrets on other CI systems.
if [[ "${TRAMPOLINE_CI}" == "kokoro" ]]; then
# This script will create 4 files:
# This script will create 5 files:
# - testing/test-env.sh
# - testing/service-account.json
# - testing/client-secrets.json
# - testing/cloudai-samples-secrets.sh
# - testing/cloudsql-samples-secrets.sh
./scripts/decrypt-secrets.sh
fi

source ./testing/test-env.sh
source ./testing/cloudai-samples-secrets.sh
source ./testing/cloudsql-samples-secrets.sh
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json

# For cloud-run session, we activate the service account for gcloud sdk.
@@ -209,7 +211,7 @@ cd "$ROOT"

# Remove secrets if we used decrypt-secrets.sh.
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
rm testing/{test-env.sh,client-secrets.json,service-account.json,cloudai-samples-secrets.sh}
rm testing/{test-env.sh,client-secrets.json,service-account.json,cloudai-samples-secrets.sh,cloudsql-samples-secrets.sh}
fi

exit "$RTN"
4 changes: 4 additions & 0 deletions scripts/decrypt-secrets.sh
Original file line number Diff line number Diff line change
@@ -46,3 +46,7 @@ gcloud secrets versions access latest \
--secret="cloudai-samples-secrets" \
--project="python-docs-samples-tests" \
> testing/cloudai-samples-secrets.sh
gcloud secrets versions access latest \
--secret="python-docs-samples-cloud-sql-secrets" \
--project="cloud-sql-connector-testing" \
> testing/cloudsql-samples-secrets.sh