Add 'update' to releaser script
authorColeman Watts <coleman@civicrm.org>
Wed, 17 Apr 2013 23:16:00 +0000 (16:16 -0700)
committerColeman Watts <coleman@civicrm.org>
Wed, 17 Apr 2013 23:16:00 +0000 (16:16 -0700)
tools/scripts/releaser/releaser

index 3bdbc436713ed73bb4dad1b612136d77a3de7af5..e02d1db8842da7501e4561bc1bacd96f6ed422b0 100755 (executable)
@@ -19,8 +19,9 @@ if [ -z "$start_point" -o -z "$version" -o -z "$first_act" ]; then
   echo "Usage:"
   echo "  $0 <start_point> <version> --build"
   echo "  $0 <start_point> <version> --publish"
+  echo "  $0 <start_point> <version> --update"
   echo "  $0 <start_point> <version> --clean"
-  echo "  $0 <start_point> <version> --build --publish --clean [[ORDER SIGNIFICANT]]"
+  echo "  $0 <start_point> <version> --build --publish --update --clean [[ORDER SIGNIFICANT]]"
   echo "Arguments:"
   echo "  <start_point> is a branch name (e.g. \"master\")"
   echo "  <version> is Civi release (e.g. \"4.3.beta2\"); it will become a tag name"
@@ -163,6 +164,22 @@ function do_publish() {
   echo $version > $latest/latest.txt
 }
 
+#################################################
+## Update Version Info
+function do_update() {
+  # FIXME: This assumes one-digit point versions
+  point=(${version: -1})
+  point=`expr $point + 1`
+  new_ver=(${version:0:4})
+  new_ver=$new_ver$point
+  cd $workdir/$version/export
+  sed -i -e "s/$version/$new_ver/g" xml/version.xml
+  sed -i -e "s/$version/$new_ver/g" sql/civicrm_generated.mysql
+  git add xml/version.xml sql/civicrm_generated.mysql
+  git commit -m "Update version to $new_ver"
+  git push origin "$version"
+}
+
 #################################################
 ## Cleanup
 function do_cleanup() {
@@ -193,6 +210,11 @@ for ACT in "$@" ; do
       do_publish
       set +x
       ;;
+    --update)
+      set -ex
+      do_update
+      set +x
+      ;;
     --clean)
       set -ex
       do_cleanup