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

@ -67,6 +67,7 @@ endif
docker push $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag) docker push $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
install: install:
@which glide || (curl https://glide.sh/get | sh)
@glide install @glide install
update: update:

View File

@ -3,12 +3,11 @@ FROM golang:1.6.2-alpine
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com> MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
ENV VERSION #VERSION# ENV VERSION #VERSION#
RUN apk --update add git make RUN apk --update add git make curl
RUN go get github.com/Masterminds/glide && cd $GOPATH/src/github.com/Masterminds/glide && make install
RUN mkdir -p $GOPATH/src/github.com/appleboy/gorush RUN mkdir -p $GOPATH/src/github.com/appleboy/gorush
Add build.tar.gz $GOPATH/src/github.com/appleboy/gorush/ Add build.tar.gz $GOPATH/src/github.com/appleboy/gorush/
WORKDIR $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 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 CMD tar -C bin -czf - gorush

View File

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

4
glide.lock generated
View File

@ -1,8 +1,8 @@
hash: d182f8dc3162313af09e706a0ba4901218d9ccde609ee7d39c6aae5e891f20ee hash: d182f8dc3162313af09e706a0ba4901218d9ccde609ee7d39c6aae5e891f20ee
updated: 2016-07-19T15:42:04.799126082+08:00 updated: 2016-07-19T21:31:48.923940945+08:00
imports: imports:
- name: github.com/appleboy/gorush - name: github.com/appleboy/gorush
version: 5b2018147493092e5f15f2f9e42142acf0eebc51 version: af78db59b4675cf932aaa71fd45443ac9283bce7
subpackages: subpackages:
- config - config
- gorush - gorush