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