[ci/on-merge-unsupported-ftrs] Reuse the on-merge build (#159162)

Passing `KIBANA_BUILD_ID` to a triggered pipeline will let us reuse the
Kibana distribution from the parent pipeline, instead of requiring a
distribution rebuild. This will also be useful for triggering the
serverless tests in a separate pipeine.

Before:
https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/2899
After:
https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/2900

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jon 2023-06-09 13:52:31 -05:00 committed by GitHub
parent 28566aa8ee
commit e82005e0d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -3,4 +3,4 @@
set -euo pipefail
echo "--- Trigger unsupported ftr tests"
ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-on-merge-unsupported-ftrs "$BUILDKITE_BRANCH" "$BUILDKITE_COMMIT"
ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-on-merge-unsupported-ftrs "$BUILDKITE_BRANCH" "$BUILDKITE_COMMIT" "$BUILDKITE_BUILD_ID"

View file

@ -11,6 +11,7 @@ import { BuildkiteClient } from '#pipeline-utils';
const pipelineSlug = process.argv[2];
const branch = process.argv[3] || 'main';
const commit = process.argv[4] || 'HEAD';
const kibanaBuildId = process.argv[5] || '';
(async () => {
try {
@ -18,6 +19,9 @@ const commit = process.argv[4] || 'HEAD';
const build = await client.triggerBuild(pipelineSlug, {
commit,
branch,
env: {
...(kibanaBuildId && { KIBANA_BUILD_ID: kibanaBuildId }),
},
ignore_pipeline_branch_filters: true, // Required because of a Buildkite bug
});
console.log(`Triggered build: ${build.web_url}`);