blob: 0e777565769f7f7597d61ed9e961fc4b0d8ce795 [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
21ssh -p 29418 gerrit.onosproject.org projectlock lock onos-yang-tools $OYT_BRANCH
22
23mvn versions:set -DnewVersion=$OYT_VERSION versions:commit
24mvn -Prelease clean deploy
25git commit -am"Releasing $OYT_VERSION"
26git tag -sm"Tagging $OYT_VERSION" $OYT_VERSION
27
28mvn versions:set -DnewVersion=$OYT_SNAPSHOT versions:commit
29git commit -am"Bumping version to $OYT_SNAPSHOT"
30git push origin $OYT_BRANCH
31git push origin $OYT_TAG
32
Ray Milkeyaf9e1f02017-03-03 09:20:46 -080033ssh -p 29418 gerrit.onosproject.org projectlock unlock onos-yang-tools $OYT_BRANCH
Ray Milkey7d8084e2017-02-09 13:46:20 -080034
35unset OYT_VERSION OYT_SNAPSHOT OYT_BRANCH OYT_TAG