-
Notifications
You must be signed in to change notification settings - Fork 121
/
.travis.yml
72 lines (63 loc) · 2.45 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
dist: xenial
sudo: required
language: go
go:
- 1.x
- master
install: true
# TODO (Karun): This works only if travis has k8s environment. Hence commenting it for now.
#install:
# - go get -v github.com/onsi/ginkgo/ginkgo
# - go get -v github.com/onsi/gomega
# - export PATH=$PATH:$HOME/gopath/bin
# TODO (Karun): This works only if travis has k8s environment. Hence commenting it for now.
# script: ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --cover --trace --race --compilers=2
services:
- docker
env:
global:
- REPO=quay.io/huawei-cni-genie
- PLUGINREPO=quay.io/huawei-cni-genie/genie-plugin
- ADMREPO=quay.io/huawei-cni-genie/genie-admission-controller
- POLICYREPO=quay.io/huawei-cni-genie/genie-policy-controller
before_script:
- mkdir -p $HOME/gopath/src/github.com/cni-genie/CNI-Genie
- rsync -az ${TRAVIS_BUILD_DIR}/ $HOME/gopath/src/github.com/cni-genie/CNI-Genie
- export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/cni-genie/CNI-Genie
- cd $HOME/gopath/src/github.com/cni-genie/CNI-Genie
jobs:
include:
- stage: "Test Jobs"
script:
- make
- stage: Unit Test
script:
- make test print=y
- stage: E2E Tests
script:
- chmod +x e2e/scripts/kube-cluster.sh
- bash e2e/scripts/kube-cluster.sh
- sleep 30
- chmod +x e2e/scripts/e2e.sh
- bash -x e2e/scripts/e2e.sh
after_success:
- docker --version
- echo 'Travis commit is:\n'
- echo $TRAVIS_COMMIT
- echo 'Travis Build Number is:\n'
- echo $TRAVIS_BUILD_NUMBER
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" $REPO
- docker build -t cnigenie -f conf/1.8/Dockerfile .
- docker tag cnigenie:latest $PLUGINREPO:$TAG
- docker tag cnigenie:latest $PLUGINREPO:$TRAVIS_BUILD_NUMBER
- docker push $PLUGINREPO
- docker build -t genie-adm -f controllers/network-admission-controller/Dockerfile controllers/network-admission-controller
- docker tag genie-adm:latest $ADMREPO:$TAG
- docker tag genie-adm:latest $ADMREPO:$TRAVIS_BUILD_NUMBER
- docker push $ADMREPO
- docker build -t genie-policy -f controllers/network-policy-controller/Dockerfile controllers/network-policy-controller
- docker tag genie-policy:latest $POLICYREPO:$TAG
- docker tag genie-policy:latest $POLICYREPO:$TRAVIS_BUILD_NUMBER
- docker push $POLICYREPO
- docker logout $REPO