2016-03-27 12:20:57 +00:00
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
VERSION=0.0.1
|
|
|
|
|
|
|
|
DEPS := $(wildcard *.go)
|
2016-04-11 06:10:46 +00:00
|
|
|
BUILD_IMAGE := "appleboy/gopush-build:latest"
|
|
|
|
TEST_IMAGE := "appleboy/gopush-testing:latest"
|
2016-03-27 12:20:57 +00:00
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
build: clean
|
2016-03-27 14:37:54 +00:00
|
|
|
sh script/build.sh
|
2016-03-27 12:20:57 +00:00
|
|
|
|
2016-04-11 06:10:46 +00:00
|
|
|
test:
|
|
|
|
cd gopush && go test -v -covermode=count -coverprofile=coverage.out
|
|
|
|
|
2016-03-27 12:20:57 +00:00
|
|
|
docker_build: clean
|
2016-03-27 14:37:54 +00:00
|
|
|
tar -zcvf build.tar.gz gopush.go gopush script
|
2016-04-11 06:10:46 +00:00
|
|
|
docker build --rm -t $(BUILD_IMAGE) -f docker/Dockerfile.build .
|
|
|
|
docker run --rm $(BUILD_IMAGE) > bin.tar.gz
|
2016-03-27 12:20:57 +00:00
|
|
|
tar -zxvf bin.tar.gz
|
2016-03-27 13:07:11 +00:00
|
|
|
-rm -rf bin.tar.gz build.tar.gz
|
2016-03-27 12:20:57 +00:00
|
|
|
|
2016-04-11 06:10:46 +00:00
|
|
|
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"
|
2016-04-10 03:36:49 +00:00
|
|
|
|
2016-03-27 12:20:57 +00:00
|
|
|
clean:
|
|
|
|
rm -rf build.tar.gz bin.tar.gz bin/*
|