diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-11-14 20:30:44 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-11-14 20:30:44 -0200 |
commit | e9cff8c1551d6ad967ae3b7da772d81a05eee8c6 (patch) | |
tree | 7763a2f7e411b8b181a344e95e44bc8bd432667b /templates | |
parent | b7ec2c22bda6e2fad72e49cd13e41ca476a56a7e (diff) | |
download | puppet-drupal-e9cff8c1551d6ad967ae3b7da772d81a05eee8c6.tar.gz puppet-drupal-e9cff8c1551d6ad967ae3b7da772d81a05eee8c6.tar.bz2 |
Storing per-action hashes at drupal_iterate and other enhancements
Diffstat (limited to 'templates')
-rw-r--r-- | templates/drupal.sh.erb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/templates/drupal.sh.erb b/templates/drupal.sh.erb index 51a10d5..8e419ae 100644 --- a/templates/drupal.sh.erb +++ b/templates/drupal.sh.erb @@ -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. |