forked from HyperSpaceChain/obc-peer-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (67 loc) · 2.96 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
# Openblockchain Continuous Integration Config file
# Go langugage
language: go
sudo: required
dist: trusty
#white list
branches:
only:
- master
#- workbranch
services:
- docker
go:
- 1.6
#- 1.5.2
env:
- GO15VENDOREXPERIMENT=1
before_install:
- export TR_PULL_REQUEST="$TRAVIS_PULL_REQUEST"
- export GIT_USER="$TRAVIS_REPO_SLUG"
- USER_NAME="$(echo $GIT_USER | cut -d '/' -f 1)"
- ip="$(ifconfig docker0 | grep "inet addr:" | awk '{print $2}' | cut -d ':' -f 2)"
- echo "Printing Docker0 Interface $ip"
- port="$(ps -ef | grep docker | awk '{print $11}' | cut -d ':' -f 3)"
- echo "Docker Deamon Port Number $port"
- sudo stop docker
- sudo docker daemon -H tcp://0.0.0.0:$port -H unix:///var/run/docker.sock > /dev/null 2>&1 &
- echo "curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" > tempsh.sh
- chmod +x tempsh.sh && sudo ./tempsh.sh
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get -qq update && sudo apt-get -qq install g++-4.8 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
install:
- sudo pip install --upgrade pip
- sudo pip install behave
- sudo apt-get install build-essential -y
- cd /opt && sudo git clone --branch v4.1 --single-branch --depth 1 https://github.com/facebook/rocksdb.git && cd rocksdb && sudo make shared_lib
- sudo cp /opt/rocksdb/*.so* /usr/lib/
- export LD_LIBRARY_PATH=/opt/rocksdb:$LD_LIBRARY_PATH
- sudo apt-get update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev
- export CGO_CFLAGS="-I/opt/rocksdb/include"
- export CGO_LDFLAGS="-L/opt/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy"
before_script:
- cd $HOME/gopath/src/github.com/$USER_NAME/obc-peer
- chmod +x foldercopy.sh
- ./foldercopy.sh $TR_PULL_REQUEST $USER_NAME
- cd /$HOME/gopath/src/github.com/openblockchain/obc-peer
- go build
- sudo rm -rf /var/openchain/ && sudo mkdir /var/openchain/ && sudo chown $USER:$USER /var/openchain
- echo "Successfully Build the application ... Moving ahead....."
script:
- ./obc-peer peer &
- go test -timeout=20m $(go list github.com/openblockchain/obc-peer/... | grep -v /vendor/ | grep -v /examples/) > build-result.txt
- chmod +x deploy.sh && sudo ./deploy.sh
- cat /$HOME/gopath/src/github.com/openblockchain/obc-peer/build-result.txt
- ps -ef | grep obc-peer | grep -v grep | kill -9 `awk '{print $2}'`
- cd $HOME/gopath/src/github.com/openblockchain/obc-peer/openchain/peer/bddtests/
- sed -i -e 's/172.17.0.1:4243\b/'"$ip:$port"'/g' $HOME/gopath/src/github.com/openblockchain/obc-peer/openchain/peer/bddtests/compose-defaults.yml
#- behave -n "chaincode example 02 single peer"
- behave
- echo " ******* Pushing Docker Images to Docker Hub ***********"
- curl -v http://169.53.62.117/cgi-bin/buildobcimage.sh
notifications:
slack: 'openchain:5YSkRUyUTke93O6YkvXjagjg'
email:
recipients:
on_success: always
on_failure: always