-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Rally release job to Buildkite (#1720)
- Loading branch information
Showing
5 changed files
with
60 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
steps: | ||
- label: "Release Docker Artifacts for Rally :docker:" | ||
command: echo "TODO" | ||
- input: "Build parameters" | ||
fields: | ||
- text: "RELEASE_VERSION" | ||
key: "RELEASE_VERSION" | ||
default: "" | ||
hint: "The version to release e.g. '2.8.0'." | ||
|
||
- wait | ||
- label: "Release Docker Artifacts for Rally" | ||
command: bash .buildkite/release-docker/run.sh | ||
# Run on GCP to use `docker` | ||
agents: | ||
provider: gcp |
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,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
# based on https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746?permalink_comment_id=4155247#gistcomment-4155247 | ||
function retry { | ||
local retries=$1 | ||
shift | ||
local cmd=($@) | ||
local cmd_string="${@}" | ||
local count=0 | ||
|
||
# be lenient with non-zero exit codes, to allow retries | ||
set +o errexit | ||
set +o pipefail | ||
until "${cmd[@]}"; do | ||
retcode=$? | ||
wait=$(( 2 ** count )) | ||
count=$(( count + 1)) | ||
if [[ $count -le $retries ]]; then | ||
printf "Command [%s] failed. Retry [%d/%d] in [%d] seconds.\n" "$cmd_string" $count $retries $wait | ||
sleep $wait | ||
else | ||
printf "Exhausted all [%s] retries for command [%s]. Exiting.\n" "$cmd_string" $retries | ||
# restore settings to fail immediately on error | ||
set -o errexit | ||
set -o pipefail | ||
return $retcode | ||
fi | ||
done | ||
# restore settings to fail immediately on error | ||
set -o errexit | ||
set -o pipefail | ||
return 0 | ||
} | ||
|
||
set +x | ||
RELEASE_VERSION=$(buildkite-agent meta-data get RELEASE_VERSION) | ||
# login to docker registry | ||
DOCKER_PASSWORD=$(vault read -field token /secret/ci/elastic-rally/release/docker-hub-rally) | ||
retry 5 docker login -u elasticmachine -p $DOCKER_PASSWORD | ||
unset DOCKER_PASSWORD | ||
|
||
set -x | ||
export TERM=dumb | ||
export LC_ALL=en_US.UTF-8 | ||
./release-docker.sh "$RELEASE_VERSION" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.