Yuta HIGUCHI | 4e751d0 | 2018-05-11 10:22:11 -0700 | [diff] [blame] | 1 | #!/bin/bash -e |
Ray Milkey | 2afc4a5 | 2017-11-17 11:01:38 -0800 | [diff] [blame] | 2 | |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 3 | # exit on errors |
| 4 | set -eu -o pipefail |
| 5 | |
Ray Milkey | 2afc4a5 | 2017-11-17 11:01:38 -0800 | [diff] [blame] | 6 | # set up ONOS build environment |
| 7 | ONOS_ROOT=`pwd` |
| 8 | . tools/build/envDefaults |
| 9 | |
Ray Milkey | b867be8 | 2017-11-27 13:29:19 -0800 | [diff] [blame] | 10 | # import GPG key |
| 11 | gpg --import jenkins.key |
Yuta HIGUCHI | 4e751d0 | 2018-05-11 10:22:11 -0700 | [diff] [blame] | 12 | |
Ray Milkey | 2afc4a5 | 2017-11-17 11:01:38 -0800 | [diff] [blame] | 13 | # set up release build credentials |
| 14 | . onos-build-credentials |
| 15 | |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 16 | # configure git settings |
| 17 | git config user.email "jenkins@onlab.us" |
Ray Milkey | 094fd00 | 2017-11-22 10:21:59 -0800 | [diff] [blame] | 18 | git config user.name "ONOS Jenkins User" |
| 19 | |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 20 | # install boto |
| 21 | pip install -U boto |
| 22 | |
Ray Milkey | 43e7f93 | 2017-11-27 08:48:42 -0800 | [diff] [blame] | 23 | # stage the maven settings |
| 24 | mkdir -p ~/.m2 |
| 25 | mv settings.xml ~/.m2/settings.xml |
| 26 | |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 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 |
Ray Milkey | 7d774fb | 2017-12-05 14:57:30 -0800 | [diff] [blame] | 33 | |
| 34 | # set user to use for uploading javadocs |
| 35 | WIKI_USER="jenkins" |
| 36 | export WIKI_USER |
| 37 | |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 38 | # lock gerrit to prevent checkins |
Ray Milkey | 884a2b8 | 2018-05-22 08:29:45 -0700 | [diff] [blame] | 39 | ssh -p 29418 gerrit.onosproject.org projectlock lock onos ${GERRIT_BRANCH} |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 40 | |
| 41 | # unlock on exit |
Ray Milkey | 884a2b8 | 2018-05-22 08:29:45 -0700 | [diff] [blame] | 42 | trap "ssh -p 29418 gerrit.onosproject.org projectlock unlock onos ${GERRIT_BRANCH}" EXIT |
Ray Milkey | 8791b89 | 2017-12-12 11:02:41 -0800 | [diff] [blame] | 43 | |
| 44 | # get the sources |
| 45 | git checkout $GERRIT_BRANCH |
| 46 | |
Ray Milkey | 2afc4a5 | 2017-11-17 11:01:38 -0800 | [diff] [blame] | 47 | # run the build |
| 48 | onos-build-and-upload ${ONOS_VERSION} ${ONOS_NEXT_VERSION} ${GERRIT_BRANCH} |