github.com/myafeier/fabric@v1.0.1-0.20170722181825-3a4b1f2bce86/.travis.yml (about) 1 # Copyright IBM Corp. All Rights Reserved. 2 # 3 # SPDX-License-Identifier: Apache-2.0 4 # 5 6 language: go 7 go: 8 - 1.7 9 sudo: required 10 services: 11 - docker 12 env: 13 - TEST_TARGET=unit-test 14 - TEST_TARGET=behave 15 - TEST_TARGET=node-sdk-unit-tests 16 17 before_install: 18 19 - echo "Starting Docker Daemon " 20 - | 21 export TR_PULL_REQUEST="$TRAVIS_PULL_REQUEST" && export GIT_USER="$TRAVIS_REPO_SLUG" 22 USER_NAME="$(echo $GIT_USER | cut -d '/' -f 1)" && REPO_NAME="$(echo $GIT_USER | cut -d '/' -f 2)" 23 ip="$(ifconfig docker0 | grep "inet addr:" | awk '{print $2}' | cut -d ':' -f 2)" 24 port="$(ps -ef | grep docker | awk '{print $10}' | cut -d ':' -f 3 | cut -d '' -f 1)" 25 sudo stop docker 26 sudo docker daemon -H tcp://0.0.0.0:$port -H unix:///var/run/docker.sock >> dockerlogfile.log 2>&1 & 27 28 install: 29 30 - echo " INSTALLING DEPENDENCIES " 31 - | 32 cd $HOME/gopath/src/github.com/$USER_NAME/$REPO_NAME 33 git clone https://github.com/hyperledger/fabric-baseimage.git 34 cd $HOME/gopath/src/github.com/$USER_NAME/$REPO_NAME/fabric-baseimage/scripts/devenv && chmod +x setup.sh && sudo ./setup.sh 35 rm -rf ../../../fabric-baseimage 36 echo " Compilers & Dependencies " 37 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 38 sudo apt-get install build-essential -y 39 sudo ldconfig 40 41 before_script: 42 43 - echo " CREATING BASE IMAGE " 44 - cd $HOME/gopath/src/github.com/$USER_NAME/$REPO_NAME/scripts && chmod +x foldercopy.sh && ./foldercopy.sh $TR_PULL_REQUEST $USER_NAME $REPO_NAME 45 - sudo rm -rf /var/hyperledger/ && sudo mkdir /var/hyperledger/ && sudo chown $USER:$USER /var/hyperledger 46 - cd /$HOME/gopath/src/github.com/hyperledger/fabric 47 - make linter 48 49 script: 50 51 - echo "Executing Tests" 52 - cd $HOME/gopath/src/github.com/hyperledger/fabric 53 - sed -i -e 's/172.17.0.1:2375\b/'"$ip:$port"'/g' $HOME/gopath/src/github.com/hyperledger/fabric/bddtests/compose-defaults.yml 54 - export BEHAVE_OPTS="-D logs=Y -o testsummary.log" #Defined to both jobs. 55 - make $TEST_TARGET 56 57 after_failure: 58 59 - | 60 echo "Click below links to view behave container log files" 61 cd $HOME/gopath/src/github.com/hyperledger/fabric 62 chmod +x scripts/containerlogs.sh 63 sudo ./scripts/containerlogs.sh 64 65 notifications: 66 67 slack: 'hyperledgerproject:azMP8Mw3cfGigXkqi5RujZXr' 68 on_success: always 69 on_failure: always