mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[es-snapshots] Trigger packer cache job using API instead of pipeline (#133246)
This commit is contained in:
parent
401ef7c76f
commit
04ed6f8df1
5 changed files with 42 additions and 11 deletions
12
.buildkite/package-lock.json
generated
12
.buildkite/package-lock.json
generated
|
@ -8,7 +8,7 @@
|
|||
"name": "kibana-buildkite",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"kibana-buildkite-library": "git+https://git@github.com/elastic/kibana-buildkite-library#4ecaba35293fb635cf92ca205ee84fca52f19e2e"
|
||||
"kibana-buildkite-library": "git+https://git@github.com/elastic/kibana-buildkite-library#6a73a417decc52f309ede3644577c9dca7b411a2"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.scandir": {
|
||||
|
@ -368,8 +368,8 @@
|
|||
},
|
||||
"node_modules/kibana-buildkite-library": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "git+https://git@github.com/elastic/kibana-buildkite-library.git#4ecaba35293fb635cf92ca205ee84fca52f19e2e",
|
||||
"integrity": "sha512-AjX3YyovsyYQ7MBoXQcHdyuFbnYZIChxr+gGApTFVNvJx4z9FeuKxQLKfDuONlZpNliHHgaenmf5APU/ZUqxVA==",
|
||||
"resolved": "git+https://git@github.com/elastic/kibana-buildkite-library.git#6a73a417decc52f309ede3644577c9dca7b411a2",
|
||||
"integrity": "sha512-SMW4Eoc/Tkg2lW63iB34obeiqCMhW4a7n3wWa7Ps63eI7+74QlIJha6K5Fa4fO/08ABZ6nEqsWeAOYAFnVLF7g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/rest": "^18.10.0",
|
||||
|
@ -839,9 +839,9 @@
|
|||
}
|
||||
},
|
||||
"kibana-buildkite-library": {
|
||||
"version": "git+https://git@github.com/elastic/kibana-buildkite-library.git#4ecaba35293fb635cf92ca205ee84fca52f19e2e",
|
||||
"integrity": "sha512-AjX3YyovsyYQ7MBoXQcHdyuFbnYZIChxr+gGApTFVNvJx4z9FeuKxQLKfDuONlZpNliHHgaenmf5APU/ZUqxVA==",
|
||||
"from": "kibana-buildkite-library@git+https://git@github.com/elastic/kibana-buildkite-library#4ecaba35293fb635cf92ca205ee84fca52f19e2e",
|
||||
"version": "git+https://git@github.com/elastic/kibana-buildkite-library.git#6a73a417decc52f309ede3644577c9dca7b411a2",
|
||||
"integrity": "sha512-SMW4Eoc/Tkg2lW63iB34obeiqCMhW4a7n3wWa7Ps63eI7+74QlIJha6K5Fa4fO/08ABZ6nEqsWeAOYAFnVLF7g==",
|
||||
"from": "kibana-buildkite-library@git+https://git@github.com/elastic/kibana-buildkite-library#6a73a417decc52f309ede3644577c9dca7b411a2",
|
||||
"requires": {
|
||||
"@octokit/rest": "^18.10.0",
|
||||
"axios": "^0.21.4",
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"kibana-buildkite-library": "git+https://git@github.com/elastic/kibana-buildkite-library#4ecaba35293fb635cf92ca205ee84fca52f19e2e"
|
||||
"kibana-buildkite-library": "git+https://git@github.com/elastic/kibana-buildkite-library#6a73a417decc52f309ede3644577c9dca7b411a2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,3 @@ steps:
|
|||
command: .buildkite/scripts/steps/es_snapshots/promote.sh
|
||||
agents:
|
||||
queue: kibana-default
|
||||
- wait
|
||||
- trigger: kibana-agent-packer-cache
|
||||
async: true
|
||||
branches: main
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
echo "--- Promote snapshot"
|
||||
export ES_SNAPSHOT_MANIFEST="${ES_SNAPSHOT_MANIFEST:-"$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST)"}"
|
||||
|
||||
cat << EOF | buildkite-agent annotate --style "info"
|
||||
|
@ -11,3 +12,8 @@ cat << EOF | buildkite-agent annotate --style "info"
|
|||
EOF
|
||||
|
||||
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
|
||||
fi
|
||||
|
|
29
.buildkite/scripts/steps/trigger_packer_cache.js
Normal file
29
.buildkite/scripts/steps/trigger_packer_cache.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
const { BuildkiteClient } = require('kibana-buildkite-library');
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const client = new BuildkiteClient();
|
||||
const build = await client.triggerBuild('kibana-agent-packer-cache', {
|
||||
commit: 'HEAD',
|
||||
branch: 'main',
|
||||
ignore_pipeline_branch_filters: true, // Required because of a Buildkite bug
|
||||
});
|
||||
console.log(`Triggered build: ${build.web_url}`);
|
||||
process.exit(0);
|
||||
} catch (ex) {
|
||||
console.error('Buildkite API Error', ex.toString());
|
||||
if (ex.response) {
|
||||
console.error('HTTP Error Response Status', ex.response.status);
|
||||
console.error('HTTP Error Response Body', ex.response.data);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue