From: Silvio Rhatto Date: Fri, 4 Feb 2011 18:51:49 +0000 (-0200) Subject: Adding --upgrade parameter to deploy action X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=469583e676777f2459b731cb548336f92c84d23c;p=puppet-drupal.git Adding --upgrade parameter to deploy action --- diff --git a/templates/drupal.sh.erb b/templates/drupal.sh.erb index 9dbb850..358d07c 100644 --- a/templates/drupal.sh.erb +++ b/templates/drupal.sh.erb @@ -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