Commit 5e2e4720 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Add provision cron command

parent dd41901b
......@@ -25,6 +25,7 @@
* enable - Re-enable a site that has already been disabled. Recreates the virtual host file.
* delete - Generates a back up of the site, and then removes all references to it.
* restore - Revert to a previous backup of the site.
* cron - Run cron process for a site
*
* Not implemented yet :
* upgrade - Accepts a site package (backup) as argument, and redeploys it, running the upgrade processes on it.
......@@ -347,6 +348,12 @@ function provision_drush_command() {
'description' => 'Delete a site.'
);
$items['provision cron'] = array(
'callback' => '_provision_cron',
'description' => 'Run cron process for site.',
'arguments' => array('domain.com' => t('The domain of the site to be processed'))
);
if (!function_exists('hosting_setup')) {
$items['provision setup'] = array(
'callback' => '_provision_setup_cmd',
......@@ -787,3 +794,19 @@ function _provision_setup_cmd() {
print "\nThe command did not complete successfully, please fix the issues and re-run this script.";
}
}
/**
* Drush command to run cron
*/
function _provision_cron($url) {
if (!_provision_drupal_site_installed($url)) {
provision_log("Error", "Site has not been installed yet.");
provision_set_error(PROVISION_SITE_NOT_FOUND);
provision_output($url, $data);
}
$data = provision_get_site_data($url);
_provision_drupal_switch_active_site($url);
drupal_cron_run();
_provision_drupal_switch_active_site();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment