Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
This automates release prepping a bit.

Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed Jun 17, 2016
1 parent a293d82 commit b1f2772
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions contrib/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Relase-prep script

if [[ $# -eq 0 ]]; then
echo "Version number is required"
exit 1
fi
if [[ $# -gt 1 ]]; then
echo "Only one argument (version) is allowed"
exit 2
fi

RELEASE=$1
CUR_RELTAG=`git tag -l | tail -1`
NEW_RELTAG=v${RELEASE}

echo "Prepping for release ${RELEASE}"

cat <<EOF > version.m4
m4_define([VERSION_NUMBER], [${RELEASE}])
EOF

git commit version.m4 -s -m "Release ${RELEASE}"

git tag ${NEW_RELTAG}

autoreconf -f -i && ./configure && make DESTDIR=${PWD}/testinst && make dist
if [[ $? -ne 0 ]]; then
echo "Release prep failed"
exit 3
fi

sha512sum mod_auth_gssapi-$1.tar.gz > mod_auth_gssapi-$1.tar.gz.shas512sum.txt
git shortlog ${CUR_RELTAG}..${NEW_RELTAG} | sed 's/^\([a-Z]\)\(.*\)/* \1\2/' > shortlog.txt
echo "Release ready to be pushed"

0 comments on commit b1f2772

Please sign in to comment.