[ci] Fix serverless project creation (#174403)

In https://github.com/elastic/kibana/pull/173159 we authenticated with
another service account, and were no longer operating under the expected
config. This was causing `gcloud secrets` to access the wrong project
and throw errors.

This revokes the service account after we're done uploading CDN assets
so we can switch back to the default service account.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jon 2024-01-08 03:02:14 -06:00 committed by GitHub
parent 58de8d4800
commit 88612c4517
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -145,6 +145,9 @@ export DEPLOY_TAGGER_SLACK_WEBHOOK_URL
GCS_SA_CDN_QA_KEY="$(vault_get gcs-sa-cdn-qa key)"
export GCS_SA_CDN_QA_KEY
GCS_SA_CDN_QA_EMAIL="$(vault_get gcs-sa-cdn-qa email)"
export GCS_SA_CDN_QA_EMAIL
GCS_SA_CDN_QA_BUCKET="$(vault_get gcs-sa-cdn-qa bucket)"
export GCS_SA_CDN_QA_BUCKET

View file

@ -95,6 +95,7 @@ CDN_ASSETS_FOLDER=$(mktemp -d)
tar -xf "kibana-$BASE_VERSION-cdn-assets.tar.gz" -C "$CDN_ASSETS_FOLDER" --strip=1
gsutil -m cp -r "$CDN_ASSETS_FOLDER/*" "gs://$GCS_SA_CDN_QA_BUCKET/$GIT_ABBREV_COMMIT"
gcloud auth revoke "$GCS_SA_CDN_QA_EMAIL"
echo "--- Upload archives"
buildkite-agent artifact upload "kibana-$BASE_VERSION-linux-x86_64.tar.gz"