#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
|
VERSION=0.0.1
|
||||||
|
|
||||||
DEPS := $(wildcard *.go)
|
DEPS := $(wildcard *.go)
|
||||||
BUILD_IMAGE := "appleboy/gopush-build:latest"
|
BUILD_IMAGE := "gopush-build"
|
||||||
TEST_IMAGE := "appleboy/gopush-testing:latest"
|
TEST_IMAGE := "gopush-testing"
|
||||||
PRODUCTION_IMAGE := "appleboy/gopush"
|
PRODUCTION_IMAGE := "gopush"
|
||||||
|
DEPLOY_ACCOUNT := "appleboy"
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
|
@ -25,5 +26,13 @@ docker_test:
|
||||||
@docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing .
|
@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"
|
@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:
|
clean:
|
||||||
-rm -rf build.tar.gz gopush.tar.gz bin/*
|
-rm -rf build.tar.gz gopush.tar.gz bin/*
|
||||||
|
|
Loading…
Reference in New Issue