Skip to content

Commit

Permalink
create alternate image tags for release candidates.
Browse files Browse the repository at this point in the history
in addition to the full version, we also create tags out of the
major and major.minor version.
  • Loading branch information
UiP9AV6Y committed Mar 27, 2018
1 parent 0b9e08a commit beb7866
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hooks/post_push
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -eu

if [[ "${DOCKER_TAG}" =~ ^v?[0-9.]+$ ]]; then
VERSION_MINOR=${DOCKER_TAG%.*}
VERSION_MAJOR=${DOCKER_TAG%%.*}

for ALT_TAG in {$VERSION_MINOR,$VERSION_MAJOR}; do
docker tag \
"${IMAGE_NAME}" \
"${DOCKER_REPO}:${ALT_TAG}"
docker push \
"${DOCKER_REPO}:${ALT_TAG}"
done
fi

0 comments on commit beb7866

Please sign in to comment.