From 30e5760cf606668f69502668d95b97e9ef9eb5a5 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Sun, 27 Oct 2019 06:42:11 -0700 Subject: [PATCH] update makefile for circleci image upload --- Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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)