fix(NA): access-multiple-gcs-buckets-when-promoting-snapshots (#176786)

Follow up for https://github.com/elastic/kibana/pull/176781 so we can
fix the access to the GCS buckets during snapshot promotion

---------

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
This commit is contained in:
Tiago Costa 2024-02-13 09:17:20 +00:00 committed by GitHub
parent 82c48aedbe
commit 32cc250bc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -62,7 +62,10 @@ if [[ -z "$EMAIL" ]]; then
EMAIL="kibana-ci-access-coverage@$GCLOUD_EMAIL_POSTFIX"
;;
"kibana-ci-es-snapshots-daily")
EMAIL="kibana-ci-access-es-snapshots@$GCLOUD_EMAIL_POSTFIX"
EMAIL="kibana-ci-access-es-daily@$GCLOUD_EMAIL_POSTFIX"
;;
"kibana-ci-es-snapshots-permanent")
EMAIL="kibana-ci-access-es-permanent@$GCLOUD_EMAIL_POSTFIX"
;;
"kibana-so-types-snapshots")
EMAIL="kibana-ci-access-so-snapshots@$GCLOUD_EMAIL_POSTFIX"

View file

@ -18,7 +18,7 @@ import { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } from './bucket_config';
throw Error('Manifest URL missing');
}
const mainCWD = process.cwd();
const projectRoot = process.cwd();
const tempDir = fs.mkdtempSync('snapshot-promotion');
process.chdir(tempDir);
@ -39,10 +39,11 @@ import { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } from './bucket_config';
execSync(
`
set -euo pipefail
${mainCWD}/.buildkite/scripts/common/activate_service_account.sh ${bucket}
${projectRoot}/.buildkite/scripts/common/activate_service_account.sh ${BASE_BUCKET_DAILY}
cp manifest.json manifest-latest-verified.json
gsutil -h "Cache-Control:no-cache, max-age=0, no-transform" cp manifest-latest-verified.json gs://${BASE_BUCKET_DAILY}/${version}/
rm manifest.json
${projectRoot}/.buildkite/scripts/common/activate_service_account.sh ${BASE_BUCKET_PERMANENT}
cp manifest-permanent.json manifest.json
gsutil -m cp -r gs://${bucket}/* gs://${BASE_BUCKET_PERMANENT}/${version}/
gsutil -h "Cache-Control:no-cache, max-age=0, no-transform" cp manifest.json gs://${BASE_BUCKET_PERMANENT}/${version}/