added travis build configuration

This commit is contained in:
Sebastian Mancke
2016-11-19 15:33:34 +01:00
parent 40a67d8e54
commit 93dc953a3f
3 changed files with 51 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash -e
# Requires installation of: `github.com/wadey/gocovmerge`
cd $GOPATH/src/github.com/smancke/guble
rm -rf ./cov
mkdir cov
i=0
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_test.go' -type d);
do
if ls ${dir}/*.go &> /dev/null; then
go test -v -covermode=atomic -coverprofile=./cov/$i.out ./${dir}
i=$((i+1))
fi
done
gocovmerge ./cov/*.out > full_cov.out
rm -rf ./cov
+27
View File
@@ -0,0 +1,27 @@
language: go
go:
- tip
services:
- docker
before_install:
- go get github.com/wadey/gocovmerge
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
script:
- go test -v ./...
- go vet ./...
after_success:
- ./.generate_coverage.sh
- goveralls -coverprofile=full_cov.out -service=travis-ci
- if [ "$TRAVIS_BRANCH" == "master" ]; then
GOOS=linux go build -a --ldflags '-linkmode external -extldflags "-static"' . ;
docker build -t tarent/loginsrv . ;
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" ;
docker push tarent/loginsrv ;
fi
+5
View File
@@ -0,0 +1,5 @@
FROM alpine
COPY loginsrv /
ENTRYPOINT ["/loginsrv"]
EXPOSE 6789