]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Adding --upgrade parameter to deploy action
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 4 Feb 2011 18:51:49 +0000 (16:51 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 4 Feb 2011 18:51:49 +0000 (16:51 -0200)
templates/drupal.sh.erb

index 9dbb85032218be4a2354fd0ea86ae7f807f401f9..358d07c8e04522b512b887391fb62c7445e5ee82 100644 (file)
@@ -68,7 +68,11 @@ function drupal_deploy {
   wget http://ftp.drupal.org/files/projects/drupal-$new.tar.gz
   tar zxvf drupal-$new.tar.gz && rm drupal-$new.tar.gz
   chown -R root.root drupal-$new/
-  cd drupal-$new && rm -rf sites
+
+  # Upgrade mode, erase sites folder as the previous should be copied.
+  if [ "$2" == "--upgrade" ]; then
+    cd drupal-$new && rm -rf sites
+  fi
 }
 
 # Upgrade a drupal instance using upstream source.
@@ -110,7 +114,7 @@ function drupal_upgrade {
   cd $BASE
   
   # Deploy a fresh drupal tree
-  drupal_deploy $new
+  drupal_deploy $new --upgrade
 
   # Ensure we're in the new drupal folder
   cd $BASE/drupal-$new