blob: 8d488b804fd9907457a8bd2ee25ff1d5e34e49f5 [file] [log] [blame]
Yuta HIGUCHI4e751d02018-05-11 10:22:11 -07001#!/bin/bash -e
Ray Milkey2afc4a52017-11-17 11:01:38 -08002
Ray Milkey8791b892017-12-12 11:02:41 -08003# exit on errors
4set -eu -o pipefail
5
Ray Milkey2afc4a52017-11-17 11:01:38 -08006# set up ONOS build environment
7ONOS_ROOT=`pwd`
8. tools/build/envDefaults
9
Ray Milkeyb867be82017-11-27 13:29:19 -080010# import GPG key
11gpg --import jenkins.key
Yuta HIGUCHI4e751d02018-05-11 10:22:11 -070012
Ray Milkey2afc4a52017-11-17 11:01:38 -080013# set up release build credentials
14. onos-build-credentials
15
Ray Milkey8791b892017-12-12 11:02:41 -080016# configure git settings
17git config user.email "jenkins@onlab.us"
Ray Milkey094fd002017-11-22 10:21:59 -080018git config user.name "ONOS Jenkins User"
19
Ray Milkey8791b892017-12-12 11:02:41 -080020# install boto
21pip install -U boto
22
Ray Milkey43e7f932017-11-27 08:48:42 -080023# stage the maven settings
24mkdir -p ~/.m2
25mv settings.xml ~/.m2/settings.xml
26
Ray Milkey8791b892017-12-12 11:02:41 -080027# stage and add the build SSH key
28chmod 600 id_rsa.pub
29ssh-add id_rsa.pub
30
31# Add the javadoc server to the list of known hosts
32ssh-keyscan -H -t rsa api.onosproject.org >>~/.ssh/known_hosts
Ray Milkey7d774fb2017-12-05 14:57:30 -080033
34# set user to use for uploading javadocs
35WIKI_USER="jenkins"
36export WIKI_USER
37
Ray Milkey8791b892017-12-12 11:02:41 -080038# lock gerrit to prevent checkins
Ray Milkey884a2b82018-05-22 08:29:45 -070039ssh -p 29418 gerrit.onosproject.org projectlock lock onos ${GERRIT_BRANCH}
Ray Milkey8791b892017-12-12 11:02:41 -080040
41# unlock on exit
Ray Milkey884a2b82018-05-22 08:29:45 -070042trap "ssh -p 29418 gerrit.onosproject.org projectlock unlock onos ${GERRIT_BRANCH}" EXIT
Ray Milkey8791b892017-12-12 11:02:41 -080043
44# get the sources
45git checkout $GERRIT_BRANCH
46
Ray Milkey2afc4a52017-11-17 11:01:38 -080047# run the build
48onos-build-and-upload ${ONOS_VERSION} ${ONOS_NEXT_VERSION} ${GERRIT_BRANCH}