From acd027bdc1d945063c07c5c5fb838506fd0eb615 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 20 Nov 2016 09:54:16 +0800 Subject: [PATCH] add version command. Signed-off-by: Bo-Yi Wu --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bf56c9b..b0f2004 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ BUILD_IMAGE := "gorush-build" PRODUCTION_IMAGE := "gorush" DEPLOY_ACCOUNT := "appleboy" ifeq ($(VERSION),) - VERSION := $(shell git describe --tags || git rev-parse --short HEAD) + VERSION := $(shell git describe --tags --always || git rev-parse --short HEAD) endif TARGETS_NOVENDOR := $(shell glide novendor) export PROJECT_PATH = /go/src/github.com/appleboy/gorush @@ -97,3 +97,6 @@ clean: gorush/gorush.db \ storage/boltdb/gorush.db \ .cover + +version: + @echo $(VERSION)