blob: 30125ef2ca53d45adcc809ae292ee26c3a312dc5 [file] [log] [blame]
Ray Milkey3aa8af52018-03-09 09:10:08 -08001#!/bin/bash
2
Ray Milkeyf45a5072018-05-10 16:04:27 +00003# exit on errors
4set -eu -o pipefail
5
Ray Milkey3aa8af52018-03-09 09:10:08 -08006# initialize build environment
7ONOS_ROOT=`pwd`
8. tools/build/envDefaults
9
10# initialize development environment for STC
Ray Milkey8c67f302018-03-09 14:23:49 -080011export JAVA_HOME=
Ray Milkey3aa8af52018-03-09 09:10:08 -080012. tools/dev/bash_profile
13
Ray Milkey7d89b3e2018-11-09 10:39:01 -080014if [ ${GERRIT_BRANCH} == "onos-1.14" ]
15then
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
17fi
18if [ ${GERRIT_BRANCH} == "onos-1.15" ]
19then
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
21fi
22if [ ${GERRIT_BRANCH} == "master" ]
23then
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
25fi
Ray Milkey3aa8af52018-03-09 09:10:08 -080026
27# always free the cell when exiting
28function cleanup {
Ray Milkey9ac211e2018-04-16 13:03:37 -070029 cell return jenkins-${ONOS_VERSION}
Ray Milkey3aa8af52018-03-09 09:10:08 -080030}
31
32trap cleanup EXIT
33
34# grab a cell to run on
Ray Milkeyf45a5072018-05-10 16:04:27 +000035cell borrow 30 3+1 jenkins-${ONOS_VERSION}
Ray Milkey3aa8af52018-03-09 09:10:08 -080036
37# build onos bits
38onos-buck build onos
39
40# set up STC parameters
41topo default
Ray Milkey6d4b1852018-04-06 08:43:48 -070042export stcDumpLogs="true"
Ray Milkey3aa8af52018-03-09 09:10:08 -080043export stcColor="false"
Ray Milkey6d4b1852018-04-06 08:43:48 -070044export stcHaltOnError="false"
45export TERM="vt100"
Ray Milkey3aa8af52018-03-09 09:10:08 -080046
47# run STC
48stc