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