blob: e85b9472cce40d86a5682cabbf42a47b30f38f25 [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
Yuta HIGUCHI6e365b22018-05-15 13:16:12 -070028mvn -B versions:set -DnewVersion=$OYT_VERSION versions:commit
29mvn -B -Prelease clean deploy -DdeployAtEnd=true
Ray Milkey7d8084e2017-02-09 13:46:20 -080030git commit -am"Releasing $OYT_VERSION"
31git tag -sm"Tagging $OYT_VERSION" $OYT_VERSION
32
Yuta HIGUCHI6e365b22018-05-15 13:16:12 -070033mvn -B versions:set -DnewVersion=$OYT_SNAPSHOT versions:commit
Ray Milkey7d8084e2017-02-09 13:46:20 -080034git commit -am"Bumping version to $OYT_SNAPSHOT"
35git push origin $OYT_BRANCH
36git push origin $OYT_TAG
Yuta HIGUCHIbb99f802018-05-15 10:45:58 -070037
Yuta HIGUCHI6e365b22018-05-15 13:16:12 -070038mvn -B -Prelease nexus-staging:release