diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2017-06-12 14:47:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-12 14:47:02 +0200 |
commit | 51f7f0871a992ffd73c0627d32c9be266ccc2693 (patch) | |
tree | 72f0975d7d693cf25ad9d2d8eb1b46f1a275de6c /dist | |
parent | 5c99b808458ce59c5fb66ffd18bdc6b66ecd6466 (diff) | |
parent | a852a86634547349300cb44c36b7f915a5f2bcc8 (diff) |
Merge pull request #2711 from yahoo/aressem/add-rpm-release-script
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 + |