#!/bin/sh # Copyright (c) 2011-2015 IndexData ApS. http://indexdata.com # Author: Wolfram Schneider # # id-release - a helper script to build a release & packaging for debian + redhat # # see http://twiki.indexdata.dk/cgi-bin/twiki/view/ID/IDSoftwareRelease # https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure # die early set -e usage () { echo >&2 "usage $0 version" echo >&2 "$@" exit 1 } branch_check () { if ! git branch | egrep -q '^\* master$'; then ( echo ">>> Warning: you are not running on the master branch <<<" git branch; echo ) 1>&2 fi } ###################################################################### branch_check case $1 in [0-9]* ) version=$1 ;; * ) usage ;; esac cat < mvn-versions.log fi if $perl; then echo "# check perl version numbers" find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' | egrep -v '^\./deb-src/' | perl -npe 's,^,# ,' fi # update debian version file perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog # update redhat version file perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec ###################################################################### echo "# Please commit the version updates now" echo "git commit -a -m'new release v$version'" echo "" echo "# Please tag now (we will push later to origin)" echo "git tag v$version" if $java; then echo "mvn versions:set -DnewVersion=$version-SNAPSHOT" fi ###################################################################### echo "" echo "# On mochi, please run the commands" echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh" echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh" echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload" echo "" echo "# if successfully, don't forget to push to origin" echo "git push origin master" echo "git push origin tag v$version" # EOF