| #!/bin/bash -ex |
| |
| # exit on errors |
| set -eu -o pipefail |
| |
| # import GPG key |
| gpg --import jenkins.key |
| |
| # set up release build credentials |
| . onos-build-credentials |
| |
| # configure git settings |
| git config user.email "jenkins@onlab.us" |
| git config user.name "ONOS Jenkins User" |
| |
| # stage the maven settings |
| mkdir -p ~/.m2 |
| mv settings.xml ~/.m2/settings.xml |
| |
| # stage and add the build SSH key |
| chmod 600 id_rsa.pub |
| ssh-add id_rsa.pub |
| |
| # get the sources |
| git checkout $GERRIT_BRANCH |
| |
| # sanity check: does the tag already exist? |
| if git rev-parse -q --verify "refs/tags/${YANGTOOLS_VERSION}"; then |
| echo "${YANGTOOLS_VERSION} tag already exists" |
| exit -1 |
| fi |
| |
| # run the release process |
| tools/onos-yang-tools-build-release ${YANGTOOLS_VERSION} ${YANGTOOLS_NEXT_VERSION} ${GERRIT_BRANCH} |