Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .buildkite/scripts/qualifier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# this file should be sourced from inside the package and publish script.

fetch_elastic_qualifier() {
local branch="${1}"
local url="https://storage.googleapis.com/dra-qualifier/${branch}"
local qualifier=""
if curl -sf -o /dev/null "${url}"; then
qualifier=$(curl -s "${url}")
fi
echo "${qualifier}"
}

# If this is a snapshot build, omit VERSION_QUALIFIER
if [ "${WORKFLOW}" = "snapshot" ]; then
VERSION_QUALIFIER=''

# If the VERSION_QUALIFIER is already set (e.g. buildkite custom run), don't modify it.
# Else try to fetch from google bucket for the current branch
elif [ -z "${VERSION_QUALIFIER+x}" ]; then
# VERSION_QUALIFIER is not set, get from bucket
VERSION_QUALIFIER="$(fetch_elastic_qualifier "${BUILDKITE_BRANCH}")"
fi
Loading