]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Storing per-action hashes at drupal_iterate and other enhancements
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 14 Nov 2012 22:30:44 +0000 (20:30 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 14 Nov 2012 22:30:44 +0000 (20:30 -0200)
templates/drupal.sh.erb

index 51a10d5b0b3f5eee14dceceb0b7ccd33e1430da5..8e419ae512f09e70b174ba2e8af90c6851c4f8de 100644 (file)
@@ -50,6 +50,14 @@ function drupal_check_not_existing {
 
 # Iterate through all drupal instances
 function drupal_iterate {
+  if [ -z "$1" ]; then
+    return
+  fi
+
+  if [ "$SILENT" != "yes" ]; then
+    echo "Issuing $1 in all installed instances..."
+  fi
+
   for version in $SERIES; do
     # Setup base folder
     base="$BASE/drupal-$version"
@@ -69,8 +77,8 @@ function drupal_iterate {
       if [ -e "$drupal/settings.php" ]; then
         hash="`sha1sum $drupal/settings.php | cut -d ' ' -f 1`"
         # Process sites just once, avoiding symlinks
-        if echo $settings_hash | grep -q -v $hash; then
-          settings_hash="$settings_hash-$hash"
+        if echo $settings_hash | grep -q -v "$1:$hash"; then
+          settings_hash="$settings_hash-$1:$hash"
           if [ "$1" != "cron" ] && [ "$SILENT" != "yes" ]; then
             echo "Processing $drupal..."
           fi
@@ -366,14 +374,14 @@ elif [ "$1" == "cron" ]; then
   drupal_iterate cron
 elif [ "$1" == "cron-update" ]; then
   SILENT="yes"
-  drupal_iterate pm-refresh $* &> /dev/null
+  drupal_iterate pm-refresh &> /dev/null
   drupal_iterate -y -p pm-update | grep -v -E 'Unknown|Up-to-date|Atualizado|Desconhecido|^Array$|^\($|^\)$|OK'
 elif [ "$1" == "deploy" ]; then
   shift
   drupal_deploy $*
 elif [ "$1" == "update" ]; then
   shift
-  drupal_iterate pm-refresh $*
+  drupal_iterate pm-refresh
   drupal_iterate pm-update $*
 
   # Update alone might not trigger updatedb in a farm for all instances.