Esempio n. 1
0
File: Check.php Progetto: funivan/ci
 /**
  * Execute the console command.
  * @throws \Exception
  */
 public function handle()
 {
     $id = $this->option('id');
     /** @var Commit $commit */
     $query = Commit::query();
     $query = $query->where('id', '=', $id);
     $commit = $query->get()->first();
     if (empty($commit)) {
         $this->getOutput()->writeln('<error>Cant find commit:' . $id . '</error>');
         return;
     }
     $checker = new \App\Ci\Checker\ScheduledChecker();
     /** @var OutputStyle $output */
     $output = $this->getOutput();
     $checker->check($commit, new PsrHandler(new ConsoleLogger($output)));
 }
Esempio n. 2
0
 /**
  * Execute the console command
  *
  * @return mixed
  */
 public function handle()
 {
     /** @var Commit $inProgressCommit */
     $inProgressCommit = Commit::query()->where('status', '=', Commit::STATUS_IN_PROGRESS)->get()->first();
     if (!empty($inProgressCommit)) {
         $this->getOutput()->writeln('Already check commit: ' . $inProgressCommit->hash);
         return;
     }
     /** @var Commit $commit */
     $commit = Commit::query()->where('status', '=', Commit::STATUS_PENDING)->get()->first();
     if (empty($commit)) {
         $this->getOutput()->writeln('Done');
         return;
     }
     $checker = new \App\Ci\Checker\ScheduledChecker();
     $checker->check($commit);
 }