bumpversion.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #! /bin/bash
  2. VERSION=`grep AC_INIT < configure.ac | awk -F',' '{print $2}'`
  3. FIRST=`echo $VERSION | awk -F'.' '{print $1}'`
  4. SECOND=`echo $VERSION | awk -F'.' '{print $2}'`
  5. THIRD=`echo $VERSION | awk -F'.' '{print $3}'`
  6. NEXTTHIRD=`expr ${THIRD} + 1`
  7. export DEBEMAIL=germant@miltenyibiotec.de
  8. export DEBFULLNAME="German Tischler-Höhle"
  9. function cleanup
  10. {
  11. if [ ! -z "${COMMITFILE}" ] ; then
  12. if [ -f "${COMMITFILE}" ] ; then
  13. rm -f "${COMMITFILE}"
  14. fi
  15. fi
  16. }
  17. COMMITFILE=commit_msg_$$.txt
  18. trap cleanup EXIT SIGINT SIGTERM
  19. # make sure we have the latest version
  20. git checkout experimental
  21. git pull
  22. # create commit log message
  23. joe "${COMMITFILE}"
  24. if [ ! -s "${COMMITFILE}" ] ; then
  25. echo "Empty commit log, aborting"
  26. exit 1
  27. fi
  28. # update to next minor version
  29. awk -v first=${FIRST} -v second=${SECOND} -v third=${THIRD} '/^AC_INIT/ {gsub(first"."second"."third,first"."second"."third+1);print} ; !/^AC_INIT/{print}' < configure.ac > configure.ac.tmp
  30. mv configure.ac.tmp configure.ac
  31. # update change log
  32. CHANGELOG=ChangeLog dch --distribution unstable -v ${FIRST}.${SECOND}.${NEXTTHIRD}-1
  33. # commit file
  34. git add configure.ac ChangeLog
  35. git commit -F "${COMMITFILE}"
  36. git push
  37. TAG=biobambam2_experimental_${FIRST}_${SECOND}_${NEXTTHIRD}
  38. git tag -a ${TAG} -m "biobambam2 experimental version ${FIRST}_${SECOND}_${NEXTTHIRD}"
  39. git push origin ${TAG}
  40. exit 0