add docker testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-07-30 20:55:29 +08:00
parent 410a454676
commit 30d2fd69b1
5 changed files with 16 additions and 163 deletions

View File

@@ -2,7 +2,10 @@ version: "2"
services:
gorush:
build: ./golang
build:
context: ./golang
args:
PROJECT_PATH: $PROJECT_PATH
links:
- redis
privileged: true
@@ -10,7 +13,7 @@ services:
- ANDROID_API_KEY
- ANDROID_TEST_TOKEN
volumes:
- ../:/app
- ../:$PROJECT_PATH
command: /bin/sh -c './docker/testing.sh'
redis:

View File

@@ -1,14 +1,9 @@
FROM golang:1.6.3-alpine
FROM appleboy/golang-testing
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
RUN apk update \
&& apk add git make curl perl && rm -rf /var/cache/apk/*
ARG PROJECT_PATH
# install glide package management.
RUN curl https://glide.sh/get | sh
ENV PROJECT_PATH=$PROJECT_PATH
RUN mkdir /app && mkdir -p $GOPATH/src/github.com/appleboy
RUN ln -sf /app $GOPATH/src/github.com/appleboy/gorush
WORKDIR $GOPATH/src/github.com/appleboy/gorush
WORKDIR $PROJECT_PATH

View File

@@ -9,6 +9,4 @@ sed -i"" -e "s/localhost/redis/g" config/config.go
sed -i"" -e "s/localhost/redis/g" config/config_test.go
sed -i"" -e "s/localhost/redis/g" gorush/status_test.go
sed -i"" -e "s/localhost/redis/g" storage/redis/redis_test.go
make install
make coverage
make report
make install && coverage all