Ray Milkey | 7c8b3f2 | 2018-08-13 15:01:12 -0700 | [diff] [blame^] | 1 | #!/bin/bash -e |
| 2 | |
| 3 | # exit on errors |
| 4 | set -eu -o pipefail |
| 5 | |
| 6 | # set up ONOS build environment |
| 7 | ONOS_ROOT=`pwd` |
| 8 | . tools/build/envDefaults |
| 9 | |
| 10 | # import GPG key |
| 11 | gpg --import jenkins.key |
| 12 | |
| 13 | # set up release build credentials |
| 14 | . onos-build-credentials |
| 15 | |
| 16 | # configure git settings |
| 17 | git config user.email "jenkins@onlab.us" |
| 18 | git config user.name "ONOS Jenkins User" |
| 19 | |
| 20 | # install boto |
| 21 | pip install -U boto |
| 22 | |
| 23 | # stage the maven settings |
| 24 | mkdir -p ~/.m2 |
| 25 | mv settings.xml ~/.m2/settings.xml |
| 26 | |
| 27 | # stage and add the build SSH key |
| 28 | chmod 600 id_rsa.pub |
| 29 | ssh-add id_rsa.pub |
| 30 | |
| 31 | # Add the javadoc server to the list of known hosts |
| 32 | ssh-keyscan -H -t rsa api.onosproject.org >>~/.ssh/known_hosts |
| 33 | |
| 34 | # set user to use for uploading javadocs |
| 35 | WIKI_USER="jenkins" |
| 36 | export WIKI_USER |
| 37 | |
| 38 | # lock gerrit to prevent checkins |
| 39 | ssh -p 29418 gerrit.onosproject.org projectlock lock onos ${GERRIT_BRANCH} |
| 40 | |
| 41 | # unlock on exit |
| 42 | trap "ssh -p 29418 gerrit.onosproject.org projectlock unlock onos ${GERRIT_BRANCH}" EXIT |
| 43 | |
| 44 | # get the sources |
| 45 | git checkout $GERRIT_BRANCH |
| 46 | |
| 47 | # run the build |
| 48 | onos-build-and-upload ${ONOS_VERSION} ${ONOS_NEXT_VERSION} ${GERRIT_BRANCH} |