From 7dfdbbde89cb3d3cc0fa9e7259890e82ef6d77c7 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 19 Nov 2016 21:21:37 +0800 Subject: [PATCH] add version command. Signed-off-by: Bo-Yi Wu --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3e9c3f2..b6f7e20 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: install build test html update docker_build docker_image docker docker_deploy clean -VERSION := $(shell git describe --tags || git rev-parse --short HEAD) +VERSION := $(shell git describe --tags --always || git rev-parse --short HEAD) DEPLOY_ACCOUNT := "appleboy" DEPLOY_IMAGE := "drone-scp" @@ -42,4 +42,7 @@ endif docker push $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE):$(tag) clean: - rm -rf coverage.txt ${DEPLOY_IMAGE} + rm -rf coverage.txt $(DEPLOY_IMAGE) + +version: + @echo $(VERSION)