Merge branch 'master' of ssh://git.indexdata.com:222/home/git/pub/git-tools
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 19 Aug 2015 07:37:06 +0000 (07:37 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 19 Aug 2015 07:37:06 +0000 (07:37 +0000)
id-release

index fd71ce8..02d1d80 100755 (executable)
@@ -1,10 +1,11 @@
 #!/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
@@ -21,11 +22,21 @@ case $1 in
        * ) usage ;;
 esac
 
-echo "Did you updated the news log file?"
+cat <<EOF
+#!/bin/sh
+#
+# See also https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure
+#
+
+set -e
+
+EOF
+
+echo "# Did you updated the news log file?"
 for file in Changes News NEWS
 do
   if [ -e $file ]; then
-    ls -l $file
+    echo "# $(ls -l $file)"
   fi
 done
 echo ""
@@ -42,7 +53,7 @@ else
     perl=false
 fi
 
-if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then
+if [ `ls | egrep '\.spec$' | wc -l` -eq 0 ]; then
     usage "No *.spec file found"
 else
     spec=`ls |egrep '\.spec$' | head -1`
@@ -56,13 +67,14 @@ fi
 perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
 
 if $java; then
-    echo "set maven version to $version"
+    echo "# set maven version to $version"
     mvn versions:set -DnewVersion=$version > 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/'
+  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
@@ -72,16 +84,12 @@ perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog
 perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec
 
 
-
 ######################################################################
-echo ""
 echo "# Please commit the version updates now"
 echo "git commit -a -m'new release v$version'"
 echo ""
-echo "# Please run now"
-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" 
@@ -89,32 +97,15 @@ fi
 
 ######################################################################
 echo ""
-echo "# On RedHat or centos, please run the commands"
-echo "sudo date # ask for password early"
-echo "git pull"
+echo "# On mochi, 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 "# if successfully, scp the package to ftp.indexdata.dk (kebab)"
-echo "\$HOME/proj/git-tools/id-rpm-build/upload-rpms.sh $spec"
-echo ""
-echo "# on kebab run: sudo su"
-echo "#               cd $HOME/proj/git-tools/update-archive && ./update-yum-archive.sh"
-
-
-######################################################################
-echo ""
-echo "# On debian or ubuntu, please run the commands"
-echo "sudo rm -rf deb-src"
-echo "git pull"
-echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh"
-echo "\$HOME/proj/git-tools/id-deb-build/id-mk-deb-src.sh"
-echo "sudo \$HOME/proj/git-tools/id-deb-build/id-pbuild.sh"
-echo "# if successfully, scp the package to ftp.indexdata.dk (kebab)"
+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 "# on kebab run: sudo su"
-echo "#               cd $HOME/proj/git-tools/update-archive && ./update-archive.sh"
-echo ""
 
+echo "# if successfully, don't forget to push to origin"
+echo "git push origin master"
+echo "git push origin tag v$version"
+
+# EOF