X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-release;h=22035f8ae5797901e071e36276d6ed54710915c4;hb=430f7d4e15965d1fde3504a2b4dfb42394bef5ec;hp=874d503fc1708125c7095947053577c59cb1a2fa;hpb=4676cdf817148e60c1ba6e3b2e1299be3efafe8d;p=git-tools-moved-to-github.git diff --git a/id-release b/id-release index 874d503..22035f8 100755 --- a/id-release +++ b/id-release @@ -1,10 +1,57 @@ #!/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 "usage $0 version" + 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]' + 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 run now" -echo "git commit -a" -echo "git push" +echo "# Please tag now (we will push later to origin)" echo "git tag v$version" -echo "git push origin 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 +