]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Adding SILENT mode and drupal-update action into cron
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 27 Sep 2012 03:13:59 +0000 (00:13 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 27 Sep 2012 03:13:59 +0000 (00:13 -0300)
manifests/init.pp
templates/drupal.sh.erb

index 76136931aafc62d143c553c3cd97fb20a899b79d..d0a6e6bf99f3d2bc79ac90351b1a39c53d82e656 100644 (file)
@@ -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,
index 62c9aef786b34076642792ce820cad62b42d055d..9285ba80f4a0bca882132df8bd1df661c3d0eae0 100644 (file)
@@ -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 $*