Skip to content

Commit 3106e5f

Browse files
committed
chore: dont docker tag rc as latest
- add guard for rc releases; publish them to docker hub with the matching git tag - make the semver regex stricter and only publish as latest when a full semver tag with no pre-release suffix is the name of the git tag. - add `release` tag as an alias of `latest` as per #3999 (comment) Tested manually as the push-docker-tag.sh script is set up for it: ```shell ./push-docker-tags.sh $(date -u +%F) testingsha release v0.9.0-test dry Nothing to do. No docker tag defined for branch: release, tag: v0.9.0-test ./push-docker-tags.sh $(date -u +%F) testingsha release v0.9.0-rc1 dry DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:v0.9.0-rc1 docker push ipfs/go-ipfs:v0.9.0-rc1 ./push-docker-tags.sh $(date -u +%F) testingsha release v0.9.0 dry DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:v0.9.0 docker push ipfs/go-ipfs:v0.9.0 DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:latest docker push ipfs/go-ipfs:latest DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:release docker push ipfs/go-ipfs:release ``` fixes #3999 License: MIT Signed-off-by: Oli Evans <[email protected]>
1 parent ef866a1 commit 3106e5f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/push-docker-tags.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# A bit like dockerhub autobuild config, but somewhere we can version control it.
77
#
88
# The `docker-build` job in .circleci/config.yml builds the current commit
9-
# in docker and tags it as ipfs/go-ipfs:wip
9+
# in docker and tags it as ipfs/go-ipfs:wip
1010
#
1111
# Then the `docker-publish` job runs this script to decide what tag, if any,
1212
# to publish to dockerhub.
@@ -59,9 +59,13 @@ pushTag () {
5959
fi
6060
}
6161

62-
if [[ $GIT_TAG =~ ^v[0-9]+ ]]; then
62+
if [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then
63+
pushTag "$GIT_TAG"
64+
65+
elif [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
6366
pushTag "$GIT_TAG"
6467
pushTag "latest"
68+
pushTag "release" # see: https://github.com/ipfs/go-ipfs/issues/3999#issuecomment-742228981
6569

6670
elif [ "$GIT_BRANCH" = "feat/stabilize-dht" ]; then
6771
pushTag "bifrost-${BUILD_NUM}-${GIT_SHA1_SHORT}"

0 commit comments

Comments
 (0)