コード例 #1
0
 /**
  * @return bool|null
  * @throws \App\Satis\Exceptions\PackageBuildFailedException
  */
 public function build()
 {
     $this->configPersister->lock($this->buildContext->getItemId());
     $command = new BuildCommand($this->buildContext->getConfigFile(), config('satis.build_directory') . DIRECTORY_SEPARATOR . $this->buildContext->getBuildDirectory(), config('satis.proxy'));
     $command->setItem($this->buildContext->getItemName());
     $output = null;
     try {
         $output = $command->withCd(base_path())->run($this->asyncMode);
     } catch (PackageBuildFailedException $e) {
         $output = $e->getMessage();
     } finally {
         if ($this->asyncMode === false) {
             $this->configPersister->unlock($this->buildContext->getItemId());
         }
     }
     return $output;
 }