mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[buildkite] Several small tweaks and cleanup (#114006)
This commit is contained in:
parent
9df3db075f
commit
4d8d7ee0ad
4 changed files with 41 additions and 22 deletions
|
@ -8,8 +8,6 @@ node scripts/build_kibana_platform_plugins \
|
|||
--scan-dir "$KIBANA_DIR/test/interpreter_functional/plugins" \
|
||||
--scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \
|
||||
--scan-dir "$KIBANA_DIR/examples" \
|
||||
--scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \
|
||||
--scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \
|
||||
--scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \
|
||||
--scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \
|
||||
--scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
node .buildkite/scripts/lifecycle/print_agent_links.js || true
|
||||
|
||||
IS_TEST_EXECUTION_STEP="$(buildkite-agent meta-data get "${BUILDKITE_JOB_ID}_is_test_execution_step" --default '')"
|
||||
|
||||
if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
|
||||
echo "--- Upload Artifacts"
|
||||
buildkite-agent artifact upload 'target/junit/**/*'
|
||||
buildkite-agent artifact upload 'target/kibana-*'
|
||||
buildkite-agent artifact upload 'target/kibana-coverage/jest/**/*'
|
||||
|
@ -22,6 +25,7 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
|
|||
buildkite-agent artifact upload 'x-pack/test/functional/failure_debug/html/*.html'
|
||||
buildkite-agent artifact upload '.es/**/*.hprof'
|
||||
|
||||
echo "--- Run Failed Test Reporter"
|
||||
node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
|
||||
|
||||
if [[ -d 'target/test_failures' ]]; then
|
||||
|
|
|
@ -4,12 +4,12 @@ set -euo pipefail
|
|||
|
||||
source .buildkite/scripts/common/util.sh
|
||||
|
||||
node .buildkite/scripts/lifecycle/print_agent_links.js
|
||||
node .buildkite/scripts/lifecycle/print_agent_links.js || true
|
||||
|
||||
echo '--- Job Environment Setup'
|
||||
|
||||
cd '.buildkite'
|
||||
yarn install
|
||||
retry 5 15 yarn install
|
||||
cd -
|
||||
|
||||
BUILDKITE_TOKEN="$(retry 5 5 vault read -field=buildkite_token_all_jobs secret/kibana-issues/dev/buildkite-ci)"
|
||||
|
|
|
@ -1,21 +1,38 @@
|
|||
const NOW = new Date();
|
||||
const TWO_HOURS = new Date(NOW.getTime() + 2 * 60 * 60 * 1000);
|
||||
const { BuildkiteClient } = require('kibana-buildkite-library');
|
||||
|
||||
const METRICS_URL = [
|
||||
`https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`,
|
||||
`/app/metrics/link-to/host-detail/${process.env.BUILDKITE_AGENT_NAME}`,
|
||||
`?to=${TWO_HOURS.getTime()}`,
|
||||
`&from=${NOW.getTime()}`,
|
||||
].join('');
|
||||
(async () => {
|
||||
try {
|
||||
const client = new BuildkiteClient();
|
||||
const build = await client.getCurrentBuild();
|
||||
|
||||
const LOGS_URL = [
|
||||
`https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`,
|
||||
`/app/logs/link-to/host-logs/${process.env.BUILDKITE_AGENT_NAME}`,
|
||||
`?time=${NOW.getTime()}`,
|
||||
].join('');
|
||||
const job = build.jobs.find((j) => j.id === process.env.BUILDKITE_JOB_ID);
|
||||
const startTime = job ? new Date(job.started_at) : new Date().getTime() - 60 * 60 * 1000;
|
||||
const twoHours = new Date(startTime.getTime() + 2 * 60 * 60 * 1000);
|
||||
|
||||
console.log('--- Agent Debug Links');
|
||||
console.log('Agent Metrics:');
|
||||
console.log('\u001b]1339;' + `url='${METRICS_URL}'\u0007`);
|
||||
console.log('Agent Logs:');
|
||||
console.log('\u001b]1339;' + `url='${LOGS_URL}'\u0007`);
|
||||
const METRICS_URL = [
|
||||
`https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`,
|
||||
`/app/metrics/link-to/host-detail/${process.env.BUILDKITE_AGENT_NAME}`,
|
||||
`?to=${twoHours.getTime()}`,
|
||||
`&from=${startTime.getTime()}`,
|
||||
].join('');
|
||||
|
||||
const LOGS_URL = [
|
||||
`https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`,
|
||||
`/app/logs/link-to/host-logs/${process.env.BUILDKITE_AGENT_NAME}`,
|
||||
`?time=${startTime.getTime()}`,
|
||||
].join('');
|
||||
|
||||
console.log('--- Agent Debug Links');
|
||||
console.log('Agent Metrics:');
|
||||
console.log('\u001b]1339;' + `url='${METRICS_URL}'\u0007`);
|
||||
console.log('Agent Logs:');
|
||||
console.log('\u001b]1339;' + `url='${LOGS_URL}'\u0007`);
|
||||
} catch (ex) {
|
||||
// Probably don't need to fail the build for this failure, just log it
|
||||
console.error('Buildkite API Error', ex.message);
|
||||
if (ex.response) {
|
||||
console.error('HTTP Error Response Status', ex.response.status);
|
||||
console.error('HTTP Error Response Body', ex.response.data);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue