Use git ref, which must be supplied
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e
-if [ $# -ne 1 ]; then
- echo "Usage: $0 <version>"
+if [ $# -ne 2 ]; then
+ echo "Usage: $0 <version> <git ref>"
exit 1
fi
readonly VERSION=$1
+readonly GITREF=$2
readonly SPECFILE="dist/vespa.spec"
readonly RPM_BRANCH="rpmbuild"
readonly CURRENT_BRANCH=$(git branch | grep "^\*" | cut -d' ' -f2)
@@ -17,9 +18,9 @@ git checkout master
git pull --rebase
# Delete existing branch if exists and create new one
-git push origin :$RPM_BRANCH &> /dev/null || true
+git push --delete origin &> /dev/null || true
git branch -D $RPM_BRANCH &> /dev/null || true
-git checkout -b $RPM_BRANCH $VERSION
+git checkout -b $RPM_BRANCH $GITREF
# Tito expects spec file to be on root
git mv $SPECFILE .
