Ray Milkey | 9eb5851 | 2018-08-15 10:52:12 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # exit on errors |
| 4 | set -eu -o pipefail |
| 5 | |
| 6 | # initialize build environment |
| 7 | ONOS_ROOT=`pwd` |
| 8 | . tools/build/envDefaults |
| 9 | |
| 10 | # initialize development environment for STC |
| 11 | export JAVA_HOME= |
| 12 | . tools/dev/bash_profile |
| 13 | |
| 14 | # Install bazel |
| 15 | curl -L -o bazel.sh https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel-0.15.2-installer-linux-x86_64.sh |
| 16 | chmod +x bazel.sh |
| 17 | ./bazel.sh --user |
| 18 | PATH=$PATH:/home/jenkins/bin |
| 19 | |
| 20 | # always free the cell when exiting |
| 21 | function cleanup { |
| 22 | cell return jenkins-${ONOS_VERSION} |
| 23 | } |
| 24 | |
| 25 | trap cleanup EXIT |
| 26 | |
| 27 | # grab a cell to run on |
| 28 | cell borrow 30 3+1 jenkins-${ONOS_VERSION} |
| 29 | |
| 30 | # build onos bits |
| 31 | bazel build onos |
| 32 | |
| 33 | # set up STC parameters |
| 34 | topo default |
| 35 | export stcDumpLogs="true" |
| 36 | export stcColor="false" |
| 37 | export stcHaltOnError="false" |
| 38 | export TERM="vt100" |
| 39 | |
| 40 | # run STC |
| 41 | stc setup && stc net-trellis-hag-smoke |