Skip to content

Commit

Permalink
Adds a mutable tag for scanner (#512)
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy St. Clair <timothysc@gmail.com>
  • Loading branch information
timothysc authored Jul 30, 2018
1 parent 606034d commit c01fb18
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ PLATFORMS := $(subst $(SPACE),$(COMMA),$(foreach arch,$(LINUX_ARCH),linux/$(arch
# --tags allows detecting non-annotated tags as well as annotated ones
GIT_VERSION ?= $(shell git describe --always --dirty --tags)
IMAGE_VERSION ?= $(shell git describe --always --dirty --tags)
IMAGE_TAG := $(shell echo $(IMAGE_VERSION) | cut -d. -f1,2)
IMAGE_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD | sed 's/\///g')
GIT_REF = $(shell git rev-parse --short=8 --verify HEAD)

Expand Down Expand Up @@ -84,6 +85,7 @@ pre:
build_container:
$(DOCKER) build \
-t $(REGISTRY)/$(TARGET):$(IMAGE_VERSION) \
-t $(REGISTRY)/$(TARGET):$(IMAGE_TAG) \
-t $(REGISTRY)/$(TARGET):$(IMAGE_BRANCH) \
-t $(REGISTRY)/$(TARGET):$(GIT_REF) \
-f $(DOCKERFILE) \
Expand Down Expand Up @@ -124,8 +126,9 @@ push_images:
$(DOCKER) push $(REGISTRY)/$(TARGET):$(GIT_REF)
if git describe --tags --exact-match >/dev/null 2>&1; \
then \
$(DOCKER) tag $(REGISTRY)/$(TARGET):$(IMAGE_VERSION) $(REGISTRY)/$(TARGET):latest; \
$(DOCKER) tag $(REGISTRY)/$(TARGET):$(IMAGE_VERSION) $(REGISTRY)/$(TARGET):$(IMAGE_TAG) $(REGISTRY)/$(TARGET):latest ; \
$(DOCKER) push $(REGISTRY)/$(TARGET):$(IMAGE_VERSION); \
$(DOCKER) push $(REGISTRY)/$(TARGET):$(IMAGE_TAG); \
$(DOCKER) push $(REGISTRY)/$(TARGET):latest; \
fi

Expand Down

0 comments on commit c01fb18

Please sign in to comment.