-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[buildkite]: get version qualifier from google bucket (#2950)
* [buildkite]: get version qualifier from google bucket * omit version qualifier on snapshot builds * omit version qualifier on snapshot builds * omit version qualifier on snapshot builds * fix
- Loading branch information
1 parent
787fe8d
commit a9532e8
Showing
4 changed files
with
36 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |