Skip to content

Commit 9311ebf

Browse files
marainodopey
authored andcommitted
Add :latest tag to docker on the release builds.
1 parent d8982a4 commit 9311ebf

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ artifacts-tag: artifacts-linux-tag artifacts-darwin-tag
8888
# For all builds that are not tagged
8989
artifacts-master:
9090

91+
# For all builds with a release candidate tag
92+
artifacts-release-candidate: artifacts-tag
93+
9194
# For all builds with a release tag
9295
artifacts-release: artifacts-tag
9396

9497
# This command is called by travis directly *after* a successful build
9598
artifacts: artifacts-$(PUSHTYPE) docker-$(PUSHTYPE)
9699

97-
.PHONY: artifacts-master artifacts-release artifacts
100+
.PHONY: artifacts-master artifacts-release-candidate artifacts-release artifacts

make/common.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ $(foreach pkg,$(BOOTSTRAP),$(eval $(call VENDOR_BIN_TMPL,$(pkg))))
4848
# Version flags to embed in the binaries
4949
VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
5050
VERSION := $(shell echo $(VERSION) | sed 's/^v//')
51+
NOT_RC := $(shell echo $(VERSION) | grep -v -e -rc)
5152

5253
# If TRAVIS_TAG is set then we know this ref has been tagged.
5354
ifdef TRAVIS_TAG
54-
PUSHTYPE=release
55+
ifeq ($(NOT_RC),)
56+
PUSHTYPE=release-candidate
57+
else
58+
PUSHTYPE=release
59+
endif
5560
else
5661
PUSHTYPE=master
5762
endif

make/docker.mk

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,27 @@ docker-tag:
4343
docker-push-tag: docker-tag
4444
$(call DOCKER_PUSH,step-cli,$(VERSION))
4545

46+
docker-push-tag-latest:
47+
$(call DOCKER_PUSH,step-cli,latest)
48+
4649
# Rely on DOCKER_USERNAME and DOCKER_PASSWORD being set inside the CI or
4750
# equivalent environment
4851
docker-login:
4952
$Q docker login -u="$(DOCKER_USERNAME)" -p="$(DOCKER_PASSWORD)"
5053

51-
.PHONY: docker-tag docker-push-tag docker-login
54+
.PHONY: docker-tag docker-push-tag docker-push-tag-latest docker-login
5255

5356
#################################################
5457
# Targets for different type of builds
5558
#################################################
5659

57-
# For all builds on the master branch we build the container but do not push.
60+
# For all builds we build the docker container
5861
docker-master: docker
5962

60-
# For all builds of a tagged release we build and push the container.
61-
docker-release: docker-master docker-login docker-push-tag
63+
# For all builds with a release candidate tag
64+
docker-release-candidate: docker-master docker-login docker-push-tag
65+
66+
# For all builds of a release tag
67+
docker-release: docker-release-candidate docker-push-tag-latest
6268

63-
.PHONY: docker-master docker-release
69+
.PHONY: docker-master docker-release-candidate docker-release

0 commit comments

Comments
 (0)