Skip to content

Commit

Permalink
Add dated docker taggging
Browse files Browse the repository at this point in the history
  • Loading branch information
groovytron committed Apr 5, 2020
1 parent b4f434e commit 286863e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ LATEST_LABEL=latest
ALL=$(addprefix pandoc,$(VERSIONS))
VCS_REF="$(shell git rev-parse HEAD)"
BUILD_DATE="$(shell date -u +"%Y-%m-%dT%H:%m:%SZ")"
CURRENT_DATE="$(shell date +"%Y%m%d")"

.PHONY: all
all: $(ALL)
Expand All @@ -23,14 +24,16 @@ $(ALL):
.PHONY:tag
tag:
for VERSION in $(VERSIONS); do \
docker tag $(COMPOSE_BUILD_NAME):$$VERSION $(OWNER)/$(BUILD_NAME):$$VERSION; \
docker tag $(COMPOSE_BUILD_NAME):$$VERSION $(OWNER)/$(BUILD_NAME):$$VERSION && \
docker tag $(COMPOSE_BUILD_NAME):$$VERSION $(OWNER)/$(BUILD_NAME):$$VERSION-$(CURRENT_DATE); \
done && \
docker tag $(COMPOSE_BUILD_NAME):$(LATEST) $(OWNER)/$(BUILD_NAME):$(LATEST_LABEL)

.PHONY:publish
publish: tag
for VERSION in $(VERSIONS); do \
docker push $(OWNER)/$(BUILD_NAME):$$VERSION; \
docker push $(OWNER)/$(BUILD_NAME):$$VERSION && \
docker push $(OWNER)/$(BUILD_NAME):$$VERSION-$(CURRENT_DATE); \
done && \
docker push $(OWNER)/$(BUILD_NAME):$(LATEST_LABEL)

Expand Down

0 comments on commit 286863e

Please sign in to comment.