diff options
author | Arnstein Ressem <aressem@yahoo-inc.com> | 2017-06-12 14:32:43 +0200 |
---|---|---|
committer | Arnstein Ressem <aressem@yahoo-inc.com> | 2017-06-12 14:32:43 +0200 |
commit | a852a86634547349300cb44c36b7f915a5f2bcc8 (patch) | |
tree | 9c59be0b4c1cb8929fdde41668d1004f1f13429b /dist | |
parent | a035639a68c5ab46b6f886611bbae107ef052881 (diff) |
Add script to release a Vespa rpm.
Diffstat (limited to 'dist')
-rwxr-xr-x | dist/release-vespa-rpm.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/dist/release-vespa-rpm.sh b/dist/release-vespa-rpm.sh new file mode 100755 index 00000000000..4059b30b857 --- /dev/null +++ b/dist/release-vespa-rpm.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -e + +if [ $# -ne 1 ]; then + echo "Usage: $0 <version>" + exit 1 +fi + +readonly VERSION=$1 +readonly SPECFILE="dist/vespa.spec" +readonly RPM_BRANCH="rpmbuild" +readonly CURRENT_BRANCH=$(git branch | grep "^\*" | cut -d' ' -f2) + +# Make sure we are up to date +git checkout master +git pull --rebase + +# Delete existing branch if exists and create new one +git push origin :$RPM_BRANCH &> /dev/null || true +git branch -D $RPM_BRANCH &> /dev/null || true +git checkout -b $RPM_BRANCH $VERSION + +# Tito expects spec file to be on root +git mv $SPECFILE . + +# Run tito to update spec file and tag +tito init +tito tag --use-version=$VERSION --no-auto-changelog + +# Push changes and tag to branc +git push -u origin --follow-tags $RPM_BRANCH + +git checkout $CURRENT_BRANCH + |