fix makefile

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-10-01 16:11:23 +08:00
parent a1885daa9a
commit a899081055
2 changed files with 13 additions and 5 deletions

View File

@@ -5,7 +5,9 @@ BUILD_IMAGE := "gorush-build"
# docker hub project name.
PRODUCTION_IMAGE := "gorush"
DEPLOY_ACCOUNT := "appleboy"
VERSION := $(shell git describe --tags || git rev-parse --short HEAD)
ifeq ($(VERSION),)
VERSION := $(shell git describe --tags || git rev-parse --short HEAD)
endif
TARGETS_NOVENDOR := $(shell glide novendor)
export PROJECT_PATH = /go/src/github.com/appleboy/gorush
@@ -64,16 +66,16 @@ config_test: init
html:
go tool cover -html=.cover/coverage.txt
docker_build: clean
docker_build:
tar -zcvf build.tar.gz gorush.go gorush config storage Makefile glide.lock glide.yaml
sed -e "s/#VERSION#/$(VERSION)/g" docker/Dockerfile.build > docker/Dockerfile.tmp
docker build --rm -t $(BUILD_IMAGE) -f docker/Dockerfile.tmp .
docker build -t $(BUILD_IMAGE) -f docker/Dockerfile.tmp .
docker run --rm $(BUILD_IMAGE) > gorush.tar.gz
docker_production:
docker build --rm -t $(PRODUCTION_IMAGE) -f docker/Dockerfile.dist .
docker build -t $(PRODUCTION_IMAGE) -f docker/Dockerfile.dist .
docker_deploy: docker_build docker_production
docker_deploy:
ifeq ($(tag),)
@echo "Usage: make $@ tag=<tag>"
@exit 1