blob: 373a41b26b24907b755871672ee2e5a29198a614 [file] [log] [blame]
Ray Milkey3ac00792016-12-01 14:28:15 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Builds an ONOS release
4# -----------------------------------------------------------------------------
5
Ray Milkey13d3ae32017-01-03 15:00:04 -08006if [ $# -ne 3 -a $# -ne 4 ]; then
Yuta HIGUCHI10b53572018-04-30 18:28:11 -07007 echo "Usage: onos-build-release branch version next-version [--dry-run]"
Ray Milkey3ac00792016-12-01 14:28:15 -08008 echo "For example, to build rc2 on the 1.8 branch - onos-build-release onos-1.8 1.8.0-rc2 1.8.0-SNAPSHOT"
9 exit 1
10fi
11
Ray Milkey13d3ae32017-01-03 15:00:04 -080012if [ $# -eq 4 -a "${4}" != "--dry-run" ]; then
13 echo "$4 is an invalid parameter - only --dry-run allowed"
14 exit 1
15fi
16
Ray Milkey3ac00792016-12-01 14:28:15 -080017BRANCH=$1
18VERSION=$2
19NEXT_VERSION=$3
Ray Milkey13d3ae32017-01-03 15:00:04 -080020DRY_RUN=$4
Ray Milkey3ac00792016-12-01 14:28:15 -080021
22set -e
23set -x
24
Ray Milkey13d3ae32017-01-03 15:00:04 -080025IS_DRY_RUN=0
26if [ "${DRY_RUN}" == "--dry-run" ]; then
27 IS_DRY_RUN=1
28fi
Ray Milkey3ac00792016-12-01 14:28:15 -080029
Ray Milkey13d3ae32017-01-03 15:00:04 -080030# Check that environment setup is correct
Ray Milkey4867af22018-08-10 16:52:28 -070031onos-release-prerequisites ${DRY_RUN}
Ray Milkey13d3ae32017-01-03 15:00:04 -080032
Carmelo Cascone00ff4ce2020-07-29 23:48:39 -070033# FIXME: re-enable locking when projectlock will be added to new ONOS gerrit
34# or change the release process to tag a specific commit instead of the whole branch
35#if [ ${IS_DRY_RUN} -eq 0 ]; then
36# # Block commits to Gerrit
37# ssh -p 29418 gerrit.onosproject.org projectlock lock onos ${BRANCH}
38#fi
Ray Milkey3ac00792016-12-01 14:28:15 -080039
40# Prepare the build tree
Ray Milkey13d3ae32017-01-03 15:00:04 -080041onos-prepare-release $VERSION $BRANCH "onos-build-and-upload $VERSION $NEXT_VERSION $BRANCH $DRY_RUN"
Ray Milkey3ac00792016-12-01 14:28:15 -080042
Carmelo Cascone00ff4ce2020-07-29 23:48:39 -070043# See FIXME above
44#if [ ${IS_DRY_RUN} -eq 0 ]; then
45# # Unblock commits
46# ssh -p 29418 gerrit.onosproject.org projectlock unlock onos ${BRANCH}
47#fi