Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Ray Milkey | f45a507 | 2018-05-10 16:04:27 +0000 | [diff] [blame] | 3 | # exit on errors |
| 4 | set -eu -o pipefail |
| 5 | |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 6 | # initialize build environment |
| 7 | ONOS_ROOT=`pwd` |
| 8 | . tools/build/envDefaults |
| 9 | |
| 10 | # initialize development environment for STC |
Ray Milkey | 8c67f30 | 2018-03-09 14:23:49 -0800 | [diff] [blame] | 11 | export JAVA_HOME= |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 12 | . tools/dev/bash_profile |
| 13 | |
Ray Milkey | 7d89b3e | 2018-11-09 10:39:01 -0800 | [diff] [blame^] | 14 | if [ ${GERRIT_BRANCH} == "onos-1.14" ] |
| 15 | then |
| 16 | curl -L -o bazel.sh https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel-0.15.2-installer-linux-x86_64.sh |
| 17 | fi |
| 18 | if [ ${GERRIT_BRANCH} == "onos-1.15" ] |
| 19 | then |
| 20 | curl -L -o bazel.sh https://github.com/bazelbuild/bazel/releases/download/0.17.1/bazel-0.17.1-installer-linux-x86_64.sh |
| 21 | fi |
| 22 | if [ ${GERRIT_BRANCH} == "master" ] |
| 23 | then |
| 24 | curl -L -o bazel.sh https://github.com/bazelbuild/bazel/releases/download/0.19.0/bazel-0.19.0-installer-linux-x86_64.sh |
| 25 | fi |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 26 | |
| 27 | # always free the cell when exiting |
| 28 | function cleanup { |
Ray Milkey | 9ac211e | 2018-04-16 13:03:37 -0700 | [diff] [blame] | 29 | cell return jenkins-${ONOS_VERSION} |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | trap cleanup EXIT |
| 33 | |
| 34 | # grab a cell to run on |
Ray Milkey | f45a507 | 2018-05-10 16:04:27 +0000 | [diff] [blame] | 35 | cell borrow 30 3+1 jenkins-${ONOS_VERSION} |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 36 | |
| 37 | # build onos bits |
| 38 | onos-buck build onos |
| 39 | |
| 40 | # set up STC parameters |
| 41 | topo default |
Ray Milkey | 6d4b185 | 2018-04-06 08:43:48 -0700 | [diff] [blame] | 42 | export stcDumpLogs="true" |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 43 | export stcColor="false" |
Ray Milkey | 6d4b185 | 2018-04-06 08:43:48 -0700 | [diff] [blame] | 44 | export stcHaltOnError="false" |
| 45 | export TERM="vt100" |
Ray Milkey | 3aa8af5 | 2018-03-09 09:10:08 -0800 | [diff] [blame] | 46 | |
| 47 | # run STC |
| 48 | stc |