mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
chore(NA): exports target branch when using a merge queue system at buildkite env script (#170918)
This PR adds the ability for us to have an env var on buildkite to allow us to understand what is the final end target when running inside a merge queue environment. It will be useful to redirect a couple of dependent scripts that will start running inside the merge queue environment once we activate it again --------- Co-authored-by: Jon <jon@budzenski.me>
This commit is contained in:
parent
5900dff07d
commit
afd020c63d
1 changed files with 18 additions and 0 deletions
|
@ -28,6 +28,24 @@ export KIBANA_BASE_BRANCH="$KIBANA_PKG_BRANCH"
|
|||
KIBANA_PKG_VERSION="$(jq -r .version "$KIBANA_DIR/package.json")"
|
||||
export KIBANA_PKG_VERSION
|
||||
|
||||
# Detects and exports the final target branch when using a merge queue
|
||||
if [[ "$BUILDKITE_BRANCH" == "gh-readonly-queue"* ]]; then
|
||||
# removes gh-readonly-queue/
|
||||
BKBRANCH_WITHOUT_GH_MQ_PREFIX="${BUILDKITE_BRANCH#gh-readonly-queue/}"
|
||||
|
||||
# extracts target mqueue branch
|
||||
MERGE_QUEUE_TARGET_BRANCH=${BKBRANCH_WITHOUT_GH_MQ_PREFIX%/*}
|
||||
else
|
||||
MERGE_QUEUE_TARGET_BRANCH=""
|
||||
fi
|
||||
export MERGE_QUEUE_TARGET_BRANCH
|
||||
|
||||
# Exports BUILDKITE_BRANCH_MERGE_QUEUE which will use the value from MERGE_QUEUE_TARGET_BRANCH if defined otherwise
|
||||
# will fallback to BUILDKITE_BRANCH.
|
||||
BUILDKITE_BRANCH_MERGE_QUEUE="${MERGE_QUEUE_TARGET_BRANCH:-$BUILDKITE_BRANCH}"
|
||||
export BUILDKITE_BRANCH_MERGE_QUEUE
|
||||
|
||||
|
||||
BUILDKITE_AGENT_GCP_REGION=""
|
||||
if [[ "$(curl -is metadata.google.internal || true)" ]]; then
|
||||
# projects/1003139005402/zones/us-central1-a -> us-central1-a -> us-central1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue