X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-release;h=22035f8ae5797901e071e36276d6ed54710915c4;hb=839efe6d8548bf2453b282bd49cf1deca4ad079f;hp=8462c78337e7b951c805cbbc7db7eb7e2ee6cb00;hpb=401f1d6c5adeb35a2cc879a81e881eb871d421b1;p=git-tools-moved-to-github.git diff --git a/id-release b/id-release index 8462c78..22035f8 100755 --- a/id-release +++ b/id-release @@ -1,18 +1,57 @@ #!/bin/sh -# Copyright (c) 2011 IndexData ApS. http://indexdata.com +# 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" @@ -68,11 +108,15 @@ fi ###################################################################### echo "" -echo "# On RedHat or centos, please run the commands" -echo "$HOME/proj/git-tools/id-deb-build/mkdist.sh" -echo "sudo cp $package-$version.tar.gz /usr/src/redhat/SOURCES/" -echo "sudo rpmbuild -ba $spec" -echo "$HOME/proj/git-tools/id-rpm-build/upload-rpms.sh $spec" -echo "# on kebab run update-yum-archive.sh" +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