Example #1
0
 /**
  * @param \FlameCore\Seabreeze\Manifest\Environment $environment
  * @param bool $preserve
  * @return bool
  */
 public function deploy(Environment $environment, $preserve = true)
 {
     if ($this->observer) {
         $this->observer->notify('deploy.start');
     }
     foreach ($environment->getSyncJobs() as $job) {
         $mode = $job->getMode();
         if (!$this->supports($mode)) {
             continue;
         }
         $factory = $this->getFactory($mode);
         $sourceSettings = $job->getSource();
         foreach ($job->getTargets() as $targetSettings) {
             $synchronizer = $factory->create($sourceSettings, $targetSettings);
             $excludes = $job->getExcludes();
             $synchronizer->setExcludes($excludes);
             if ($this->observer) {
                 $this->observer->setData('sync', 'engine', $mode);
                 $synchronizer->observe($this->observer);
             }
             $result = $synchronizer->synchronize($preserve);
             if ($result !== null && !$result) {
                 $this->failed[] = $mode;
             }
         }
     }
     if ($this->observer) {
         $this->observer->notify('deploy.finish');
     }
     return empty($this->failed);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function getCommands(Environment $environment)
 {
     return $environment->getTests();
 }
 /**
  * {@inheritdoc}
  */
 protected function getCommands(Environment $environment)
 {
     $type = $this->getTasksType();
     return $environment->getTasks($type);
 }