From b5df590bd0d059489554abcc7ed1396770f409d7 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Thu, 11 Jan 2018 17:14:31 -0600 Subject: [PATCH] don't build release if git status is not clean --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 9987810d3..e1ed7c5d5 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ DEP := $(shell command -v dep 2>/dev/null) STATIK := $(shell command -v statik 2>/dev/null) PROTOC := $(shell command -v protoc 2>/dev/null) VERSION := $(shell git describe --tags 2> /dev/null || echo unknown) +STATUS := $(shell git status --porcelain) IDENTIFIER := $(VERSION)-$(GOOS)-$(GOARCH) CLONE_URL=github.com/pilosa/pilosa PKGS := $(shell cd $(GOPATH)/src/$(CLONE_URL); go list ./... | grep -v vendor) @@ -65,9 +66,13 @@ endif @echo "Created release build: build/pilosa-$(IDENTIFIER).tar.gz" release: +ifeq ($(STATUS),"") make release-build GOOS=darwin GOARCH=amd64 make release-build GOOS=linux GOARCH=amd64 DOCKER_BUILD=1 make release-build GOOS=linux GOARCH=386 DOCKER_BUILD=1 +else + @echo "Will not create release with unclean git status." +endif prerelease-build: vendor make pilosa FLAGS="-o build/pilosa-master-$(GOOS)-$(GOARCH)/pilosa"