Skip to content

Commit

Permalink
Fix image tag for branch commits
Browse files Browse the repository at this point in the history
  • Loading branch information
bzub committed Jul 10, 2017
1 parent db54caf commit d243f7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ go:
branches:
only:
- master
- v0.*
- /^bzub-.*$/
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/

env:
global:
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ DEV_SUFFIX?=-git
LOCAL_PACKAGES?=app app/controllers app/options app/watchers
IMG_NAMESPACE?=cloudnativelabs
GIT_COMMIT=$(shell git describe --tags --dirty)
IMG_TAG?=$(if $(IMG_TAG_PREFIX),$(IMG_TAG_PREFIX)-)
# GIT_BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
GIT_BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
IMG_TAG?=$(if $(IMG_TAG_PREFIX),$(IMG_TAG_PREFIX)-)$(GIT_BRANCH)-latest
RELEASE_TAG?=$(shell build/get-git-tag.sh)
REGISTRY?=$(if $(IMG_FQDN),$(IMG_FQDN)/$(IMG_NAMESPACE)/$(NAME),$(IMG_NAMESPACE)/$(NAME))
REGISTRY_DEV?=$(REGISTRY)$(DEV_SUFFIX)
Expand All @@ -29,6 +29,9 @@ run: kube-router ## Runs "kube-router --help".
container: kube-router ## Builds a Docker container image.
@echo Starting kube-router container image build.
$(DOCKER) build -t "$(REGISTRY_DEV):$(IMG_TAG)" .
@if [ "$(GIT_BRANCH)" = "master" ]; then \
$(DOCKER) tag "$(REGISTRY_DEV):$(IMG_TAG)" "$(REGISTRY_DEV):latest"; \
fi
@echo Finished kube-router container image build.

docker-login: ## Logs into a docker registry using {DOCKER,QUAY}_{USERNAME,PASSWORD} variables.
Expand Down

0 comments on commit d243f7d

Please sign in to comment.