From 9a2459af06b99d72791942b95aafa0e475d9c834 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 9 May 2016 17:03:02 +0800 Subject: [PATCH] add random image name. Signed-off-by: Bo-Yi Wu --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d559524..7eed148 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,10 @@ DEPS := $(wildcard *.go) BUILD_IMAGE := "gorush-build" -TEST_IMAGE := "gorush-testing" PRODUCTION_IMAGE := "gorush" DEPLOY_ACCOUNT := "appleboy" VERSION := $(shell git describe --tags) +TIMENAME := $(shell date '+%Y%m%d%H%M%S%s') all: build @@ -38,11 +38,11 @@ docker_build: clean docker build --rm -t $(PRODUCTION_IMAGE) -f docker/Dockerfile.dist . docker_test: - -docker rm -f gorush-redis - @docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing . - @docker run --name gorush-redis -d redis - @docker run --rm --link gorush-redis:redis -e ANDROID_TEST_TOKEN=$(ANDROID_TEST_TOKEN) -e ANDROID_API_KEY=$(ANDROID_API_KEY) $(TEST_IMAGE) sh -c "make test" - @docker rm -f gorush-redis + @docker build --rm -t $(TIMENAME)-test -f docker/Dockerfile.testing . + @docker run --name $(TIMENAME)-redis -d redis + @docker run --rm --link $(TIMENAME)-redis:redis -e ANDROID_TEST_TOKEN=$(ANDROID_TEST_TOKEN) -e ANDROID_API_KEY=$(ANDROID_API_KEY) $(TIMENAME)-test sh -c "make test" + @docker rm -f $(TIMENAME)-redis + @docker rmi -f $(TIMENAME)-test deploy: ifeq ($(tag),)