Skip to content

Commit

Permalink
fix(NA): run script over original cwd for promote manifest pipeline (e…
Browse files Browse the repository at this point in the history
…lastic#176781)

This PR solves a problem introduced at
elastic#174756 where the addition into
the bash script was not being correctly loaded for the promote manifest
pipeline as it was not running in the original main cwd.
  • Loading branch information
mistic authored and CoenWarmer committed Feb 15, 2024
1 parent 0b7887a commit 5b0cc86
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .buildkite/scripts/steps/es_snapshots/promote_manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } from './bucket_config';
throw Error('Manifest URL missing');
}

const mainCWD = process.cwd();
const tempDir = fs.mkdtempSync('snapshot-promotion');
process.chdir(tempDir);

Expand All @@ -35,13 +36,10 @@ import { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } from './bucket_config';

fs.writeFileSync('manifest-permanent.json', manifestPermanentJson);

const currentPath = execSync('pwd', { encoding: 'utf-8' }).trim();
console.log('Current working directory:', currentPath);

execSync(
`
set -euo pipefail
.buildkite/scripts/common/activate_service_account.sh ${bucket}
${mainCWD}/.buildkite/scripts/common/activate_service_account.sh ${bucket}
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
Expand Down

0 comments on commit 5b0cc86

Please sign in to comment.