Makefile: get rid of entire git tagging logic
Change-Id: Idaa55b636031afd214853ccfcf6c9e3b097050b1changes/34/9434/1
parent
9e631757be
commit
c400005f38
|
@ -21,11 +21,10 @@ RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.mak
|
|||
IMAGE?=$(REGISTRY_HOST)/$(NAME)
|
||||
|
||||
VERSION?=$(shell . $(RELEASE_SUPPORT) ; getRelease)
|
||||
TAG?=$(shell . $(RELEASE_SUPPORT); getTag)
|
||||
|
||||
SHELL=/bin/bash
|
||||
|
||||
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showver \
|
||||
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag showver \
|
||||
push do-push post-push
|
||||
|
||||
build: pre-build docker-build post-build
|
||||
|
@ -44,7 +43,7 @@ docker-build: .release
|
|||
@DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \
|
||||
DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \
|
||||
|
||||
docker-tag: docker-build
|
||||
tag: docker-build
|
||||
if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \
|
||||
echo docker tag -f $(IMAGE):latest $(IMAGE):$(VERSION) ;\
|
||||
docker tag -f $(IMAGE):latest $(IMAGE):$(VERSION) ;\
|
||||
|
@ -55,12 +54,11 @@ docker-tag: docker-build
|
|||
|
||||
.release:
|
||||
@echo "release=0.0.0" > .release
|
||||
@echo "tag=$(NAME)-0.0.0" >> .release
|
||||
@echo INFO: .release created
|
||||
@cat .release
|
||||
|
||||
|
||||
release: check-status check-release build push
|
||||
release: build push
|
||||
|
||||
|
||||
push: do-push post-push
|
||||
|
@ -93,22 +91,5 @@ major-release: tag-major-release release
|
|||
@echo $(VERSION)
|
||||
|
||||
|
||||
tag: TAG=$(shell . $(RELEASE_SUPPORT); getTag $(VERSION))
|
||||
tag: check-status
|
||||
@. $(RELEASE_SUPPORT) ; ! tagExists $(TAG) || (echo "ERROR: tag $(TAG) for version $(VERSION) already tagged in git" >&2 && exit 1) ;
|
||||
@. $(RELEASE_SUPPORT) ; setRelease $(VERSION)
|
||||
git add .release
|
||||
git commit -m "bumped to version $(VERSION)" ;
|
||||
git tag $(TAG) ;
|
||||
@[ -n "$(shell git remote -v)" ] && git push --tags
|
||||
|
||||
check-status:
|
||||
@. $(RELEASE_SUPPORT) ; ! hasChanges || (echo "ERROR: there are still outstanding changes" >&2 && exit 1) ;
|
||||
|
||||
check-release: .release
|
||||
@. $(RELEASE_SUPPORT) ; tagExists $(TAG) || (echo "ERROR: version not yet tagged in git. make [minor,major,patch]-release." >&2 && exit 1) ;
|
||||
@. $(RELEASE_SUPPORT) ; ! differsFromRelease $(TAG) || (echo "ERROR: current directory differs from tagged $(TAG). make [minor,major,patch]-release." ; exit 1)
|
||||
|
||||
|
||||
run:
|
||||
docker run $(RUN_ARGS) -it $(IMAGE)
|
||||
|
|
Loading…
Reference in New Issue