forked from psturc/test-apb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.sh
115 lines (105 loc) · 3.54 KB
/
travis.sh
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
#
# travis.sh
#
# This script is used by travis to test the broker
#
action=$1
export GLIDE_TARBALL="https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz"
if [[ "$action" == "before_install" ]]; then
echo "================================="
echo " Before Install "
echo "================================="
#sudo do-release-upgrade -f DistUpgradeViewNonInteractive
#sudo apt-get -qq update
sudo apt-get install -y python-apt autoconf pkg-config e2fslibs-dev libblkid-dev zlib1g-dev liblzo2-dev asciidoc
elif [[ "$action" == "install" ]]; then
echo "================================="
echo " Install "
echo "================================="
# Install ansible
sudo pip install ansible==2.3.1 pyOpenSSL==16.2.0
# dash? wtf is dash? UGH! use a real shell
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh
# install devmapper from scratch
cd $HOME
git clone http://sourceware.org/git/lvm2.git
cd lvm2
./configure
sudo make install_device-mapper
cd ..
# build btrfs from scratch
git clone https://github.com/kdave/btrfs-progs.git
cd btrfs-progs
./autogen.sh
./configure
make
sudo make install
cd $TRAVIS_BUILD_DIR
# now install deps
wget -O /tmp/glide.tar.gz $GLIDE_TARBALL
tar xfv /tmp/glide.tar.gz -C /tmp
sudo mv $(find /tmp -name "glide") /usr/bin
# install golint
go get -u github.com/golang/lint/golint
# install goveralls for coveralls integration
go get github.com/mattn/goveralls
elif [[ "$action" == "before_script" ]]; then
echo "================================="
echo " Before Script "
echo "================================="
sudo ufw disable
tmp=`mktemp`
echo '{"insecure-registries":["172.30.0.0/16"]}' > ${tmp}
sudo mv ${tmp} /etc/docker/daemon.json
sudo mount --make-shared /
sudo service docker restart
elif [[ "$action" == "lint" ]]; then
echo "================================="
echo " Lint "
echo "================================="
make lint
elif [[ "$action" == "format" ]]; then
echo "================================="
echo " Format "
echo "================================="
make fmtcheck
elif [[ "$action" == "vet" ]]; then
echo "================================="
echo " Vet "
echo "================================="
make vet
elif [[ "$action" == "build" ]]; then
echo "================================="
echo " Build "
echo "================================="
make vendor
make build
exit $?
elif [[ "$action" == "test" ]]; then
echo "================================="
echo " Test "
echo "================================="
make ci-test-coverage
elif [[ "$action" == "setup-cluster" ]]; then
echo "================================="
echo " Setup Cluster "
echo "================================="
# Add an arguemnt only when running Travis for the broker
./scripts/broker-ci/setup-cluster.sh broker
exit $?
elif [[ "$action" == "setup-broker" ]]; then
echo "================================="
echo " Setup Broker "
echo " (Only for Broker Travis job) "
echo "================================="
./scripts/broker-ci/setup-broker.sh
exit $?
elif [[ "$action" == "ci" ]]; then
echo "================================="
echo " Broker CI "
echo "================================="
make ci LOCAL_CI=false
exit $?
fi