-
Notifications
You must be signed in to change notification settings - Fork 51
/
.travis.yml
60 lines (55 loc) · 1.76 KB
/
.travis.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
sudo: enabled
language: go
go:
- "1.11"
#- tip
services:
- docker
jobs:
include:
- stage: tests
#before_install:
#- go get -t -v `go list ./...| grep -vE 'vendor|cmd|moctl'`
install:
- sudo pip install cpplint
- make init
- docker pull gcc:8.1.0
- docker pull golang:1.11.0
- docker build etc/etcd-image/v3.3.2/ -t moiot/etcd:v3.3.2
- docker build etc/mysql-image/5.7.22-pmm/ -t moiot/mysql:5.7.22-pmm
- REPOPWD=`pwd`
- echo "current pwd is "$REPOPWD
- echo "install pumba for chaos testing"
- cd $GOPATH
- mkdir -p src/github.com/alexei-led && cd src/github.com/alexei-led
- git clone https://github.com/alexei-led/pumba.git
- cd pumba
- docker build -t moiot/pumba:latest -f docker/Dockerfile .
- cd $REPOPWD
- echo "current pwd is "`pwd`
script:
- make lint
- make docker-agent
- make test
- bash <(curl -s https://codecov.io/bash)
- docker build etc/mysql-image/5.7.22-pmm/ -t moiot/mysql:5.7.22-pmm
- make integration-test || { tail -n 200 logs/mysql-*.log; sleep 10; exit 1; }
#after_success:
after_failure:
- make clean-data
- stage: publish
if: tag IS present
env: DOCKER_IMAGE=$DOCKER_IMAGE:$TRAVIS_TAG
install:
- docker pull gcc:8.1.0
- docker pull golang:1.11.0
- make docker-agent
- docker build etc/mysql-image/5.7.22-pmm/ -t moiot/mysql:5.7.22-pmm
script:
- echo "$TRAVIS_BRANCH v.s $TRAVIS_TAG"
- echo "$DOCKER_IMAGE"
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t $DOCKER_IMAGE -f ./etc/docker-compose/agent/Dockerfile.production ./etc/docker-compose/agent
- docker push $DOCKER_IMAGE
- docker image rm $DOCKER_IMAGE
- docker image prune -f