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