From 83b868cb893515188f1c16522103ce6ac063600b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Sep 2012 00:13:59 -0300 Subject: Adding SILENT mode and drupal-update action into cron --- manifests/init.pp | 9 +++++++++ templates/drupal.sh.erb | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7613693..d0a6e6b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -37,6 +37,15 @@ class drupal inherits pear { require => File['/usr/local/sbin/drupal'], } + # Keep themes and modules up-to-date + cron { "drupal-update": + command => "/usr/local/sbin/drupal cron-update", + user => root, + hour => "02", + minute => "30", + ensure => present, + } + # Drupal shared folder file { "/usr/local/share/drupal": ensure => directory, diff --git a/templates/drupal.sh.erb b/templates/drupal.sh.erb index 62c9aef..9285ba8 100644 --- a/templates/drupal.sh.erb +++ b/templates/drupal.sh.erb @@ -71,7 +71,7 @@ function drupal_iterate { # Process sites just once, avoiding symlinks if echo $settings_hash | grep -q -v $hash; then settings_hash="$settings_hash-$hash" - if [ "$1" != "cron" ]; then + if [ "$1" != "cron" ] || [ "$SILENT" != "yes" ]; then echo "Processing $drupal..." fi drush -l $drupal $* @@ -364,6 +364,9 @@ if [ -z "$1" ]; then exit 1 elif [ "$1" == "cron" ]; then drupal_iterate cron +elif [ "$1" == "cron-update" ]; then + SILENT="yes" + drupal_iterate update -y -p | grep -v -E 'Unknown|Up-to-date|Atualizado|Desconhecido' elif [ "$1" == "deploy" ]; then shift drupal_deploy $* -- cgit v1.2.3