blob: 6b96c39f13ae7af206089f33706e7b8ccafe0ef0 [file] [log] [blame]
Ray Milkey7d8084e2017-02-09 13:46:20 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Builds an ONOS Yang Tools release
4# -----------------------------------------------------------------------------
5
6if [ $# -ne 3 ]; then
7 echo "Usage: onos-yang-tools-build-release version next-version branch"
8 echo "For example, to build beta 2 on the master branch - onos-yang-tools-build-release 1.12-b2 1.12-SNAPSHOT master"
9 exit 1
10fi
11
12export OYT_VERSION=$1
13export OYT_SNAPSHOT=$2
Ray Milkeyaf9e1f02017-03-03 09:20:46 -080014export OYT_BRANCH=$3
Ray Milkey7d8084e2017-02-09 13:46:20 -080015
16set -e
17set -x
18
19export OYT_TAG=$OYT_VERSION
20
Yuta HIGUCHIa93ee972018-02-14 17:40:06 -080021function cleanup {
22 ssh -p 29418 gerrit.onosproject.org projectlock unlock onos-yang-tools $OYT_BRANCH
23}
24
Ray Milkey7d8084e2017-02-09 13:46:20 -080025ssh -p 29418 gerrit.onosproject.org projectlock lock onos-yang-tools $OYT_BRANCH
Yuta HIGUCHIa93ee972018-02-14 17:40:06 -080026trap cleanup EXIT
Ray Milkey7d8084e2017-02-09 13:46:20 -080027
28mvn versions:set -DnewVersion=$OYT_VERSION versions:commit
29mvn -Prelease clean deploy
30git commit -am"Releasing $OYT_VERSION"
31git tag -sm"Tagging $OYT_VERSION" $OYT_VERSION
32
33mvn versions:set -DnewVersion=$OYT_SNAPSHOT versions:commit
34git commit -am"Bumping version to $OYT_SNAPSHOT"
35git push origin $OYT_BRANCH
36git push origin $OYT_TAG
37
Ray Milkey7d8084e2017-02-09 13:46:20 -080038
39unset OYT_VERSION OYT_SNAPSHOT OYT_BRANCH OYT_TAG