Skip to content

Commit

Permalink
feat: Push to mutable $RALLY_VERSION tag in addition to latest an…
Browse files Browse the repository at this point in the history
…d date tags
  • Loading branch information
favilo committed Sep 27, 2024
1 parent 2374548 commit c896395
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .buildkite/release-docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ DOCKER_PASSWORD=$(vault read -field token /secret/ci/elastic-rally/release/docke
retry 5 docker login -u elasticmachine -p $DOCKER_PASSWORD
unset DOCKER_PASSWORD

set -x
tmp_dir=$(mktemp --directory)
pushd "$tmp_dir"
git clone https://github.com/elastic/rally
pushd rally

printenv

# checkout the latest version, to make sure we get the latest docker security fixes
if [[ ! -z "${BUILDKITE_BRANCH}" ]]; then
git checkout "${BUILDKITE_BRANCH}"
Expand All @@ -37,6 +34,7 @@ fi

git --no-pager show

set -x
export TERM=dumb
export LC_ALL=en_US.UTF-8
./release-docker.sh "$RELEASE_VERSION" "$ARCH" "$PUSH_LATEST"
Expand Down
2 changes: 1 addition & 1 deletion esrally/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.11.0-testing"
__version__ = "2.11.0.dev0"
1 change: 1 addition & 0 deletions it/docker_dev_image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def run_docker_compose_up(test_command):
env_variables = os.environ.copy()
env_variables["TEST_COMMAND"] = test_command
env_variables["RALLY_VERSION"] = version.__version__
env_variables["RALLY_VERSION_TAG"] = version.__version__

return process.run_subprocess_with_logging(
f"docker-compose -f {it.ROOT_DIR}/docker/docker-compose-tests.yml up --abort-on-container-exit", env=env_variables
Expand Down
22 changes: 16 additions & 6 deletions release-docker-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export GIT_SHA=$(git rev-parse --short HEAD)
export DATE=$(date +%Y%m%d)

export RALLY_VERSION_TAG="${RALLY_VERSION}-${DATE}"
export DOCKER_TAG_VERSION="${RALLY_VERSION}"
export DOCKER_TAG_LATEST="latest"

echo "========================================================"
Expand All @@ -58,27 +59,36 @@ docker manifest create elastic/rally:${RALLY_VERSION_TAG} \
--amend elastic/rally:${RALLY_VERSION_TAG}-amd64 \
--amend elastic/rally:${RALLY_VERSION_TAG}-arm64

trap push_failed ERR
echo "======================================================="
echo "Publishing Docker image elastic/rally:$RALLY_VERSION_TAG"
echo "======================================================="
docker manifest push elastic/rally:${RALLY_VERSION_TAG}
trap - ERR

if [[ $PUSH_LATEST == "true" ]]; then
trap push_failed ERR
echo "======================================================="
echo "Publishing Docker image elastic/rally:$RALLY_VERSION_TAG"
echo "Creating Docker manifest image for Rally $DOCKER_TAG_VERSION"
echo "======================================================="
docker manifest push elastic/rally:${RALLY_VERSION_TAG}
trap - ERR

docker manifest create elastic/rally:${DOCKER_TAG_VERSION} \
--amend elastic/rally:${RALLY_VERSION_TAG}-amd64 \
--amend elastic/rally:${RALLY_VERSION_TAG}-arm64

echo "======================================================="
echo "Creating Docker manifest image for Rally $DOCKER_TAG_LATEST"
echo "======================================================="

docker manifest create elastic/rally:${DOCKER_TAG_LATEST} \
--amend elastic/rally:${DOCKER_TAG_LATEST}-amd64 \
--amend elastic/rally:${DOCKER_TAG_LATEST}-arm64
--amend elastic/rally:${RALLY_VERSION_TAG}-amd64 \
--amend elastic/rally:${RALLY_VERSION_TAG}-arm64

echo "======================================================="
echo "Publishing Docker image elastic/rally:${DOCKER_TAG_LATEST}"
echo "======================================================="

trap push_failed ERR
docker manifest push elastic/rally:${DOCKER_TAG_VERSION}
docker manifest push elastic/rally:${DOCKER_TAG_LATEST}
fi

Expand Down

0 comments on commit c896395

Please sign in to comment.