#10 support deploy production image to docker hub.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
2bf88e4a4f
commit
d047841329
15
Makefile
15
Makefile
|
@ -3,9 +3,10 @@
|
|||
VERSION=0.0.1
|
||||
|
||||
DEPS := $(wildcard *.go)
|
||||
BUILD_IMAGE := "appleboy/gopush-build:latest"
|
||||
TEST_IMAGE := "appleboy/gopush-testing:latest"
|
||||
PRODUCTION_IMAGE := "appleboy/gopush"
|
||||
BUILD_IMAGE := "gopush-build"
|
||||
TEST_IMAGE := "gopush-testing"
|
||||
PRODUCTION_IMAGE := "gopush"
|
||||
DEPLOY_ACCOUNT := "appleboy"
|
||||
|
||||
all: build
|
||||
|
||||
|
@ -25,5 +26,13 @@ docker_test:
|
|||
@docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing .
|
||||
@docker run --rm -e ANDROID_TEST_TOKEN=$(ANDROID_TEST_TOKEN) -e ANDROID_API_KEY=$(ANDROID_API_KEY) $(TEST_IMAGE) sh -c "cd gopush && go test -v"
|
||||
|
||||
deploy:
|
||||
ifeq ($(tag),)
|
||||
@echo "Usage: make $@ tag=<tag>"
|
||||
@exit 1
|
||||
endif
|
||||
docker tag -f $(PRODUCTION_IMAGE):latest $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
|
||||
docker push $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
|
||||
|
||||
clean:
|
||||
-rm -rf build.tar.gz gopush.tar.gz bin/*
|
||||
|
|
Loading…
Reference in New Issue