Ray Milkey | 7d8084e | 2017-02-09 13:46:20 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Builds an ONOS Yang Tools release |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | if [ $# -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 |
| 10 | fi |
| 11 | |
| 12 | export OYT_VERSION=$1 |
| 13 | export OYT_SNAPSHOT=$2 |
Ray Milkey | af9e1f0 | 2017-03-03 09:20:46 -0800 | [diff] [blame] | 14 | export OYT_BRANCH=$3 |
Ray Milkey | 7d8084e | 2017-02-09 13:46:20 -0800 | [diff] [blame] | 15 | |
| 16 | set -e |
| 17 | set -x |
| 18 | |
| 19 | export OYT_TAG=$OYT_VERSION |
| 20 | |
Yuta HIGUCHI | a93ee97 | 2018-02-14 17:40:06 -0800 | [diff] [blame] | 21 | function cleanup { |
| 22 | ssh -p 29418 gerrit.onosproject.org projectlock unlock onos-yang-tools $OYT_BRANCH |
| 23 | } |
| 24 | |
Ray Milkey | 7d8084e | 2017-02-09 13:46:20 -0800 | [diff] [blame] | 25 | ssh -p 29418 gerrit.onosproject.org projectlock lock onos-yang-tools $OYT_BRANCH |
Yuta HIGUCHI | a93ee97 | 2018-02-14 17:40:06 -0800 | [diff] [blame] | 26 | trap cleanup EXIT |
Ray Milkey | 7d8084e | 2017-02-09 13:46:20 -0800 | [diff] [blame] | 27 | |
| 28 | mvn versions:set -DnewVersion=$OYT_VERSION versions:commit |
| 29 | mvn -Prelease clean deploy |
| 30 | git commit -am"Releasing $OYT_VERSION" |
| 31 | git tag -sm"Tagging $OYT_VERSION" $OYT_VERSION |
| 32 | |
| 33 | mvn versions:set -DnewVersion=$OYT_SNAPSHOT versions:commit |
| 34 | git commit -am"Bumping version to $OYT_SNAPSHOT" |
| 35 | git push origin $OYT_BRANCH |
| 36 | git push origin $OYT_TAG |