update docker testing script via glide.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
2e7f415b3b
commit
937f35e284
3
Makefile
3
Makefile
|
@ -36,9 +36,10 @@ docker_build: clean
|
||||||
docker build --rm -t $(PRODUCTION_IMAGE) -f docker/Dockerfile.dist .
|
docker build --rm -t $(PRODUCTION_IMAGE) -f docker/Dockerfile.dist .
|
||||||
|
|
||||||
docker_test:
|
docker_test:
|
||||||
|
-docker rm -f gorush-redis
|
||||||
@docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing .
|
@docker build --rm -t $(TEST_IMAGE) -f docker/Dockerfile.testing .
|
||||||
@docker run --name gorush-redis -d redis
|
@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 "cd gorush && go test -v"
|
@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 rm -f gorush-redis
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
|
@ -2,9 +2,12 @@ FROM golang:1.6
|
||||||
|
|
||||||
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
|
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
|
||||||
|
|
||||||
RUN mkdir -p /tmp/build
|
# install glide package management.
|
||||||
Add . /tmp/build/
|
RUN go get github.com/Masterminds/glide && cd $GOPATH/src/github.com/Masterminds/glide && make install
|
||||||
WORKDIR /tmp/build
|
RUN mkdir -p $GOPATH/src/github.com/appleboy/gorush
|
||||||
|
Add . $GOPATH/src/github.com/appleboy/gorush/
|
||||||
|
WORKDIR $GOPATH/src/github.com/appleboy/gorush
|
||||||
RUN sed -i"" -e "s/localhost/redis/g" config/config.yml
|
RUN sed -i"" -e "s/localhost/redis/g" config/config.yml
|
||||||
RUN sed -i"" -e "s/localhost/redis/g" gorush/status_test.go
|
RUN sed -i"" -e "s/localhost/redis/g" gorush/status_test.go
|
||||||
RUN go get -v -d -t ./...
|
RUN sed -i"" -e "s/localhost/redis/g" storage/redis/redis_test.go
|
||||||
|
RUN make bundle
|
||||||
|
|
|
@ -20,6 +20,7 @@ func TestRedisEngine(t *testing.T) {
|
||||||
var val int64
|
var val int64
|
||||||
|
|
||||||
config := c.BuildDefaultPushConf()
|
config := c.BuildDefaultPushConf()
|
||||||
|
config.Stat.Redis.Addr = "localhost:6379"
|
||||||
|
|
||||||
redis := New(config)
|
redis := New(config)
|
||||||
redis.Init()
|
redis.Init()
|
||||||
|
|
Loading…
Reference in New Issue