[CI] Trigger pipeline deploy when versions.json changes (#134387)

This commit is contained in:
Brian Seeders 2022-06-15 10:47:35 -04:00 committed by GitHub
parent 0d2e8e62ab
commit b32052e66a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View file

@ -11,9 +11,23 @@ steps:
automatic:
- exit_status: '*'
limit: 1
- wait
- label: 'Triggering changes-based pipelines'
branches: main
agents:
queue: kibana-default
plugins:
- chronotc/monorepo-diff#v2.0.4:
watch:
- path:
- 'versions.json'
config:
command: 'node .buildkite/scripts/steps/trigger_pipeline.js kibana-buildkite-pipelines-deploy main'
label: 'Trigger pipeline deploy'
agents:
queue: 'kibana-default'
- command: .buildkite/scripts/steps/on_merge_build_and_metrics.sh
label: Build Kibana Distribution and Plugins
agents:

View file

@ -15,5 +15,5 @@ node "$(dirname "${0}")/promote_manifest.js" "$ES_SNAPSHOT_MANIFEST"
if [[ "$BUILDKITE_BRANCH" == "main" ]]; then
echo "--- Trigger agent packer cache pipeline"
node .buildkite/scripts/steps/trigger_packer_cache.js
node .buildkite/scripts/steps/trigger_pipeline.js kibana-agent-packer-cache main
fi

View file

@ -8,12 +8,16 @@
const { BuildkiteClient } = require('kibana-buildkite-library');
const pipelineSlug = process.argv[2];
const branch = process.argv[3] || 'main';
const commit = process.argv[4] || 'HEAD';
(async () => {
try {
const client = new BuildkiteClient();
const build = await client.triggerBuild('kibana-agent-packer-cache', {
commit: 'HEAD',
branch: 'main',
const build = await client.triggerBuild(pipelineSlug, {
commit,
branch,
ignore_pipeline_branch_filters: true, // Required because of a Buildkite bug
});
console.log(`Triggered build: ${build.web_url}`);