if [ "$1" != "cron" ] && [ "$SILENT" != "yes" ]; then
echo "Processing $drupal..."
fi
- drush -l $drupal $*
+
+ if [ "$1" == "update" && "$1" == "cron-update" ]; then
+ drupal_update $1 $drupal
+ else
+ drush -l $drupal $*
+ fi
fi
fi
done
done
}
+# Update a drupal instance
+function drupal_update {
+ local method="$1"
+ local instance="$2"
+ local pipe
+
+ if [ "$method" == "" ]; then
+ pipe="--pipe"
+ fi
+
+ # See https://drupal.org/node/823146#comment-3319070
+ # Also, avoid automated core updates
+ drush -l $instance up -u 1 --pipe | grep -v -E '^drupal|Unknown|Up-to-date|Atualizado|Desconhecido|^Array$|^\($|^\)$|OK' \
+ | cut -d " " -f1 | xargs drush up -u 1 -y $pipe
+}
+
# Deploy a fresh drupal tree
function drupal_deploy {
if [ -z "$1" ]; then
elif [ "$1" == "cron-update" ]; then
SILENT="yes"
drupal_iterate pm-refresh &> /dev/null
- drupal_iterate pm-update -y -p | grep -v -E 'Unknown|Up-to-date|Atualizado|Desconhecido|^Array$|^\($|^\)$|OK'
+ drupal_iterate pm-update
elif [ "$1" == "deploy" ]; then
shift
drupal_deploy $*