Пример #1
0
 /**
  * Tests validity
  *
  * @return bool
  */
 public function isValid()
 {
     try {
         return $this->checkValidity();
     } catch (\LogicException $e) {
         $this->manager->log($e->getMessage());
         return false;
     }
 }
Пример #2
0
 protected static function findStrategy($name, $data, ConfigurationManager $manager, Source $parent = null)
 {
     if (isset($data['strategy'])) {
         return $data['strategy'];
     }
     if ($parent) {
         return $parent->getStrategy();
     }
     if (isset($data['extends']) && $manager->has('source', $data['extends'])) {
         return $manager->get('source', $data['extends'])->getStrategy();
     }
     throw new \LogicException("Cannot find a valid strategy for the source '{$name}'");
 }
Пример #3
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['deployer.configuration'] = $this->app->share(function ($app) {
         $configuration = ['directories' => $app['config']['deployer.directories'], 'servers' => $app['config']['deployer.servers'], 'sources' => $app['config']['deployer.sources'], 'tasks' => $app['config']['deployer.tasks'], 'environments' => $app['config']['deployer.environments']];
         return ConfigurationManager::create($configuration);
     });
     $this->app['command.deployer.deploy'] = $this->app->share(function ($app) {
         return new DeployCommand($app['deployer.configuration']);
     });
     $this->app['command.deployer.rollback'] = $this->app->share(function ($app) {
         return new RollbackCommand($app['deployer.configuration']);
     });
     $this->commands('command.deployer.deploy', 'command.deployer.rollback');
 }