From c400005f38c5a6f1933e13d85827d3e8e14bf9da Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 3 Jun 2018 15:53:03 +0000 Subject: [PATCH] Makefile: get rid of entire git tagging logic Change-Id: Idaa55b636031afd214853ccfcf6c9e3b097050b1 --- make/Makefile | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/make/Makefile b/make/Makefile index 91f1ded2..231b6852 100644 --- a/make/Makefile +++ b/make/Makefile @@ -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)