forked from skydive-project/skydive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (51 loc) · 2.38 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
60
language: go
go_import_path: github.com/skydive-project/skydive
go:
- 1.9.1
sudo: required
dist: xenial
before_install:
- sudo apt-get -qq update
- sudo apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y openvswitch-switch unzip docker.io build-essential flex bison libxml2-dev libz-dev liblzma-dev libicu-dev libc++-dev bridge-utils libdb5.3-dev libgraph-easy-perl screen inotify-tools realpath libnuma-dev linux-headers-$(uname -r)
- sudo ovs-vsctl show
- sudo iptables -F
- for i in $(find /proc/sys/net/bridge/ -type f) ; do echo 0 | sudo tee $i ; done
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- git clone https://github.com/the-tcpdump-group/libpcap.git
- cd libpcap
- git checkout libpcap-1.5.3
- ./configure --prefix=/usr/local --disable-shared --disable-dbus --disable-bluetooth --disable-canusb
- make
- sudo make install
- cd ..
- mkdir ${HOME}/protoc
- pushd ${HOME}/protoc
- wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip
- unzip protoc-3.1.0-linux-x86_64.zip
- popd
- export PATH=${HOME}/protoc/bin:${PATH}
script:
- export BUILD_TAG=$(date +%Y-%m-%d).${TRAVIS_JOB_NUMBER}
- export PATH=${GOPATH}/bin:${PATH}
- make WITH_EBPF=true install
- make WITH_EBPF=true static
- echo "--- DOCKER IMAGE ---"
- make docker-image DOCKER_IMAGE=${DOCKER_IMAGE} DOCKER_TAG=${BUILD_TAG}
- sudo -E docker login -e "${DOCKER_EMAIL}" -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
- sudo -E docker tag ${DOCKER_IMAGE}:${BUILD_TAG} ${DOCKER_IMAGE}:latest
- sudo -E docker push docker.io/${DOCKER_IMAGE}:${BUILD_TAG}
- sudo -E docker push docker.io/${DOCKER_IMAGE}:latest
- echo "--- BINARIES ---"
- git reset --hard
- git remote add binaries ${BINARIES_REPO}
- git fetch binaries
- git checkout -b travis-builds binaries/travis-builds
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- cp ${GOPATH}/bin/skydive skydive-latest
- git add skydive-latest
- git commit -m "${BUILD_TAG} travis build" --amend
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com" > .git/credentials
- git push -f -q binaries travis-builds