diff --git a/Makefile b/Makefile index b738c82..449e9ac 100644 --- a/Makefile +++ b/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=" + @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/*