forked from ciao-project/ciao
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
88 lines (78 loc) · 5.1 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
language: go
sudo: required
services:
- docker
go:
- 1.8
- 1.9
- tip
env: #need empty
matrix:
include:
- go: 1.9
env: TEST_CASES_FLAGS=-race
- go: 1.9
env: LINT_ONLY=1
allow_failures:
- go: tip
- go: 1.9
env: TEST_CASES_FLAGS=-race
go_import_path: github.com/ciao-project/ciao
before_install:
- sudo apt-get update -qq
- sudo apt-get install dnsmasq-base
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get github.com/pierrre/gotestcover
- go get github.com/google/gofuzz github.com/stretchr/testify
- go get -u gopkg.in/alecthomas/gometalinter.v1
- gometalinter.v1 --install
# We need to create and install SSNTP certs for the SSNTP and controller tests
before_script:
- sudo mkdir -p /etc/pki/ciao/
- sudo mkdir -p /var/lib/ciao/logs/scheduler
- sudo -E $GOPATH/bin/ciao-deploy auth setup
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor -role scheduler
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor-cert /etc/pki/ciao/cert-Scheduler-localhost.pem -role agent
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor-cert /etc/pki/ciao/cert-Scheduler-localhost.pem -role agent,netagent
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor-cert /etc/pki/ciao/cert-Scheduler-localhost.pem -role controller
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor-cert /etc/pki/ciao/cert-Scheduler-localhost.pem -role cnciagent
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor-cert /etc/pki/ciao/cert-Scheduler-localhost.pem -role netagent
- sudo -E $GOPATH/bin/ciao-cert -directory /etc/pki/ciao -host localhost -anchor-cert /etc/pki/ciao/cert-Scheduler-localhost.pem -role server
- sudo cp /etc/pki/ciao/CAcert-localhost.pem /etc/pki/ciao/ca_cert.crt
- sudo cp /etc/pki/ciao/CAcert-localhost.pem /etc/pki/ciao/CAcert-server-localhost.pem
- sudo cp /etc/pki/ciao/cert-Scheduler-localhost.pem /etc/pki/ciao/server.pem
- sudo cp /etc/pki/ciao/cert-CNAgent-localhost.pem /etc/pki/ciao/client.pem
- sudo cp /etc/pki/ciao/cert-Controller-localhost.pem /etc/pki/ciao/cert-client-localhost.pem
- sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/ciao/ciao-controller-key.pem -out /etc/pki/ciao/ciao-controller-cacert.pem -subj '/CN=localhost/O=CIAO test server/C=US'
- sudo cp /etc/pki/ciao/ciao-controller-cacert.pem /usr/local/share/ca-certificates/ciao-controller-cacert.crt
- sudo update-ca-certificates
script:
- go env
- docker --version
- sudo docker pull debian
- sudo ip link add testdummy type dummy
- sudo ip addr add 198.51.100.1/24 dev testdummy
- if [ $LINT_ONLY ]; then gometalinter.v1 --deadline=10m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck --enable=structcheck --enable=unused ./...; fi
- cd _release/bat
- if [ $LINT_ONLY ]; then gometalinter.v1 --deadline=10m --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=deadcode --enable=varcheck --enable=structcheck --enable=unused ./...; fi
- cd ../..
- sudo mkdir -p /var/lib/ciao/instances
- sudo mkdir -p /var/lib/ciao/data/controller/workloads
- sudo chmod 0777 -R /var/lib/ciao
- if [ -z $LINT_ONLY ]; then test-cases $TEST_CASES_FLAGS -v -timeout 9 -coverprofile /tmp/cover.out -short github.com/ciao-project/ciao/ciao-controller/...; fi
- if [ -z $LINT_ONLY ]; then test-cases $TEST_CASES_FLAGS -v -timeout 9 -coverprofile /tmp/cover.out -append-profile -short github.com/ciao-project/ciao/ciao-launcher github.com/ciao-project/ciao/ciao-scheduler github.com/ciao-project/ciao/payloads github.com/ciao-project/ciao/configuration github.com/ciao-project/ciao/testutil github.com/ciao-project/ciao/uuid github.com/ciao-project/ciao/qemu github.com/ciao-project/ciao/bat github.com/ciao-project/ciao/database/... github.com/ciao-project/ciao/ciao-storage/... github.com/ciao-project/ciao/deviceinfo github.com/ciao-project/ciao/osprepare; fi
- if [ -z $LINT_ONLY ]; then export GOROOT=`go env GOROOT` && sudo -E PATH=$PATH:$GOROOT/bin $GOPATH/bin/test-cases $TEST_CASES_FLAGS -v -timeout 9 -coverprofile /tmp/cover.out -append-profile github.com/ciao-project/ciao/ssntp; fi
- if [ -z $LINT_ONLY ]; then export GOROOT=`go env GOROOT` && export SNNET_ENV=198.51.100.0/24 && sudo -E PATH=$PATH:$GOROOT/bin $GOPATH/bin/test-cases -race -v -timeout 9 -short -tags travis -coverprofile /tmp/cover.out -append-profile github.com/ciao-project/ciao/networking/libsnnet; fi
after_success:
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=/tmp/cover.out
before_deploy:
- tag=`git describe --abbrev=0 --tags`
- git show $tag > /tmp/release.txt
deploy:
provider: releases
api_key: $GH_TOKEN
file: /tmp/release.txt
skip_cleanup: true
on:
tags: true