Fix gcloud secret access.

The secret access command apparently returns JSON (why!??) and the
payload is base64 encoded. Decode per the example provided in the
documentation [1].

[1] https://cloud.google.com/sdk/gcloud/reference/secrets/versions/access

PiperOrigin-RevId: 431862918
This commit is contained in:
Adin Scannell
2022-03-01 23:34:58 -08:00
committed by gVisor bot
parent c6bb9ceb66
commit 5cfaa79a1a
+1 -1
View File
@@ -43,7 +43,7 @@ sudo rm -rf /tmp/profile
# Download credentials, if a release agent.
if test "${BUILDKITE_AGENT_META_DATA_QUEUE}" = "release"; then
# Pull down secrets.
gcloud secrets versions access --secret="repo-key" latest > repo.key
gcloud secrets versions access --secret="repo-key" --format='get(payload.data)' latest | tr '_-' '/+' | base64 -d > repo.key
# Configure the Docker credential helper (to push images).
gcloud auth configure-docker -q