forked from daptin/daptin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
45 lines (36 loc) · 1.42 KB
/
Copy path.travis.yml
File metadata and controls
45 lines (36 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
language: go
go:
- 1.9.3
- tip
sudo: required
cache:
directories:
- "daptinweb/node_modules"
services:
- docker
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- ls -lah
- cat .travis.yml
- "echo 'mode: set' > c.out"
- go get -t ./...
- for pkg in $(go list ./... | grep -v vendor); do go test -coverprofile=$(echo $pkg | tr / -).cover $pkg; done ;
- ls -lah
- grep -h -v "^mode:" ./*.cover >> c.out
- cp c.out coverage.txt
- go get github.com/GeertJohan/go.rice/rice && ls -lah && curl https://glide.sh/get | sh && glide install && cd daptinweb && npm install && npm run build && cd .. && rice embed-go && ls -lah && go build -ldflags='-extldflags "-static"' -o main && mkdir docker_dir && cp ./main ./docker_dir/main && cp Dockerfile docker_dir/Dockerfile
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
cp Dockerfile docker_dir/Dockerfile && cd docker_dir && docker build -t daptin/daptin:travis . && cd ..;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push daptin/daptin:travis;
fi
- bash <(curl -s https://codecov.io/bash)
- cat /home/travis/gopath/src/github.com/daptin/daptin/coverage.txt
notifications:
email: false