Add for Travis-CI

This commit is contained in:
2016-11-17 23:39:31 +00:00
parent b4722b1011
commit 8bd6d62bdf
2 changed files with 18 additions and 5 deletions

12
.travis.yml Normal file
View File

@@ -0,0 +1,12 @@
language: go
go:
- 1.7
after_success:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -e $DOCKERHUB_EMAIL -u $DOCKERHUB_USER -p $DOCKERHUB_PASS;
export REPO=jimeh/ozu.io;
export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`;
make bin/ozuio_linux_amd64
docker build -f Dockerfile -t $REPO:$TAG .
docker push $REPO
fi

View File

@@ -11,7 +11,12 @@ SOURCES = $(shell find . -name '*.go' -o -name 'VERSION')
VERSION = $(shell cat VERSION)
OSARCH = "linux/amd64 darwin/amd64"
.DEFAULT_GOAL: $(BINARY)
.DEFAULT_GOAL: test
.PHONY: test
test: dev-deps
@govendor test +local +program
$(BINARY): $(SOURCES)
go build -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
@@ -31,10 +36,6 @@ run: $(BINARY)
install: dev-deps
@govendor install +local +program
.PHONY: test
test: dev-deps
@govendor test +local +program
.PHONY: generate
generate: dev-deps
@govendor generate +local +program