aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-02-04 16:51:49 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-02-04 16:51:49 -0200
commit469583e676777f2459b731cb548336f92c84d23c (patch)
tree25e4624a3ae6a63225a833d336953f27b83978a7
parentd0f8abe5cb8f3d7fbd88b99e670128204d9ec7d2 (diff)
downloadpuppet-drupal-469583e676777f2459b731cb548336f92c84d23c.tar.gz
puppet-drupal-469583e676777f2459b731cb548336f92c84d23c.tar.bz2
Adding --upgrade parameter to deploy action
-rw-r--r--templates/drupal.sh.erb8
1 files changed, 6 insertions, 2 deletions
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