Ejemplo n.º 1
0
 /**
  * @deprecated Will be removed. Needs refactoring to use Zed getMode().
  *
  * @return string
  */
 public function getMode()
 {
     if (Environment::isNotProduction()) {
         return self::MODE_TEST;
     }
     return self::MODE_LIVE;
 }
Ejemplo n.º 2
0
 /**
  * Gets a string with job schedule (how often run job). The schedule string is compatible
  * with cronjob schedule defininion (eg. 0 * * * * meaning: run once each hour at 00 minute).
  * If environment is development, return empty string - we execute cronjobs on development environment
  * only manually.
  *
  * @param array $job
  *
  * @return string
  */
 protected function getSchedule(array $job)
 {
     $schedule = $job['schedule'] === '' ? '' : ' <hudson.triggers.TimerTrigger><spec>' . $job['schedule'] . '</spec></hudson.triggers.TimerTrigger>';
     if (array_key_exists('run_on_non_production', $job) && $job['run_on_non_production'] === true) {
         return $schedule;
     }
     if (Environment::isNotProduction()) {
         // Non-production - don't run automatically via Jenkins
         return '';
     }
     return $schedule;
 }