diff --git a/Makefile b/Makefile index b505991..c4ce2cd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ APPNAME := merp -VERSION := $(shell git rev-parse --short HEAD) +VERSION := $(shell git rev-parse HEAD) BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ') BUILDUSER := $(shell whoami) BUILDHOST := $(shell hostname -s) @@ -52,17 +52,14 @@ dist: build-docker-image hub: upload-docker-image build-docker-image: - docker build \ - -t $(IMAGENAME):$(VERSION) \ - -t $(IMAGENAME):latest \ - -t $(IMAGENAME):$(BUILDTIMETAG) \ - . + docker build -t $(IMAGENAME) . upload-docker-image: build-docker-image - docker push $(IMAGENAME):$(VERSION) + docker tag $(IMAGENAME) $(IMAGENAME):$(BUILDTIMETAG) docker push $(IMAGENAME):$(BUILDTIMETAG) - docker push $(IMAGENAME):latest ci-upload-images: - docker push $(IMAGENAME):$(VERSION) - docker push $(IMAGENAME):$(BUILDTIMETAG) + docker tag $(IMAGENAME) $(IMAGENAME):$(CIRCLE_SHA1) + docker tag $(IMAGENAME) $(IMAGENAME):$(CIRCLE_BRANCH) + docker push $(IMAGENAME):$(CIRCLE_SHA1) + docker push $(IMAGENAME):$(CIRCLE_BRANCH)