add version command.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-11-20 09:54:16 +08:00
parent f62b6be15f
commit acd027bdc1
1 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@ BUILD_IMAGE := "gorush-build"
PRODUCTION_IMAGE := "gorush" PRODUCTION_IMAGE := "gorush"
DEPLOY_ACCOUNT := "appleboy" DEPLOY_ACCOUNT := "appleboy"
ifeq ($(VERSION),) ifeq ($(VERSION),)
VERSION := $(shell git describe --tags || git rev-parse --short HEAD) VERSION := $(shell git describe --tags --always || git rev-parse --short HEAD)
endif endif
TARGETS_NOVENDOR := $(shell glide novendor) TARGETS_NOVENDOR := $(shell glide novendor)
export PROJECT_PATH = /go/src/github.com/appleboy/gorush export PROJECT_PATH = /go/src/github.com/appleboy/gorush
@ -97,3 +97,6 @@ clean:
gorush/gorush.db \ gorush/gorush.db \
storage/boltdb/gorush.db \ storage/boltdb/gorush.db \
.cover .cover
version:
@echo $(VERSION)