fix docker testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-07-19 22:20:23 +08:00
parent 7182bfb857
commit 4c5d482ff6
4 changed files with 11 additions and 6 deletions

View File

@@ -3,12 +3,11 @@ FROM golang:1.6.2-alpine
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
ENV VERSION #VERSION#
RUN apk --update add git make
RUN go get github.com/Masterminds/glide && cd $GOPATH/src/github.com/Masterminds/glide && make install
RUN apk --update add git make curl
RUN mkdir -p $GOPATH/src/github.com/appleboy/gorush
Add build.tar.gz $GOPATH/src/github.com/appleboy/gorush/
WORKDIR $GOPATH/src/github.com/appleboy/gorush
RUN make bundle
RUN make install
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.Version=${VERSION}" -o bin/gorush gorush.go
CMD tar -C bin -czf - gorush

View File

@@ -1,7 +1,12 @@
#!/bin/sh
#
set -e
cd ${GOPATH}/src/github.com/appleboy/gorush
sed -i"" -e "s/localhost/redis/g" config/config.yml
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 bundle && make test
make install && make test