| # ----------------------------------------------------------------------------- |
| # ----------------------------------------------------------------------------- |
| if [ $# -ne 3 -a $# -ne 4 ]; then |
| echo "Usage: onos-build-release branch version next-version [--dry-run]" |
| echo "For example, to build rc2 on the 1.8 branch - onos-build-release onos-1.8 1.8.0-rc2 1.8.0-SNAPSHOT" |
| if [ $# -eq 4 -a "${4}" != "--dry-run" ]; then |
| echo "$4 is an invalid parameter - only --dry-run allowed" |
| if [ "${DRY_RUN}" == "--dry-run" ]; then |
| # Check that environment setup is correct |
| onos-release-prerequisites ${DRY_RUN} |
| if [ ${IS_DRY_RUN} -eq 0 ]; then |
| # Block commits to Gerrit |
| ssh -p 29418 gerrit.onosproject.org projectlock lock onos ${BRANCH} |
| onos-prepare-release $VERSION $BRANCH "onos-build-and-upload $VERSION $NEXT_VERSION $BRANCH $DRY_RUN" |
| if [ ${IS_DRY_RUN} -eq 0 ]; then |
| ssh -p 29418 gerrit.onosproject.org projectlock unlock onos ${BRANCH} |