From c5cb1fe2ed78122837c723c4a725fbaaa6a7f9c5 Mon Sep 17 00:00:00 2001 From: Dimitrios Liappis Date: Mon, 22 Jan 2024 16:37:18 +0200 Subject: [PATCH] Annotate successful DRA builds with summary URL (#15820) This commit makes the generated DRA URL easily accessible via a Buildkite annotation. Closes https://github.com/elastic/ingest-dev/issues/2608 --- .buildkite/scripts/dra/publish.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.buildkite/scripts/dra/publish.sh b/.buildkite/scripts/dra/publish.sh index f501b05a1d3..598da84bbb7 100755 --- a/.buildkite/scripts/dra/publish.sh +++ b/.buildkite/scripts/dra/publish.sh @@ -90,7 +90,16 @@ docker run --rm \ --workflow "${WORKFLOW_TYPE}" \ --version "${PLAIN_STACK_VERSION}" \ --artifact-set main \ - ${DRA_DRY_RUN} + ${DRA_DRY_RUN} | tee rm-output.txt + +# extract the summary URL from a release manager output line like: +# Report summary-8.22.0.html can be found at https://artifacts-staging.elastic.co/logstash/8.22.0-ABCDEFGH/summary-8.22.0.html + +SUMMARY_URL=$(grep -E '^Report summary-.* can be found at ' rm-output.txt | grep -oP 'https://\S+' | awk '{print $1}') +rm rm-output.txt + +# and make it easily clickable as a Builkite annotation +printf "**Summary link:** [${SUMMARY_URL}](${SUMMARY_URL})\n" | buildkite-agent annotate --style=success info "Teardown logins" $(dirname "$0")/docker-env-teardown.sh