Esempio n. 1
0
 /**
  * @param $suiteName
  * @param array $suiteConfigs
  */
 protected function addSuite($suiteName, array $suiteConfigs)
 {
     $suite = new Suite();
     $suite->setDi($this->getDi());
     $suite->setProject($this);
     $suite->setName($suiteName);
     $suite->setSuiteConfigs($suiteConfigs);
     $this->suites[$suiteName] = $suite;
 }
Esempio n. 2
0
 /**
  * @param Suite $suite
  * @return \stdClass
  */
 protected function prepareBody(Suite $suite)
 {
     $jobUrl = $this->getConfig()->host_url . '/raw-job-viewer?id=' . $suite->getJobEntity()->id;
     $body = new \stdClass();
     $body->notify = true;
     $body->message = $suite->getName() . ' completed!';
     if ($suite->getJobEntity()->exit_code == 0) {
         $body->color = 'green';
     } else {
         $body->color = 'red';
     }
     $body->card = new \stdClass();
     $body->card->style = 'application';
     $body->card->title = 'Build #' . $suite->getProject()->getBuildEntity()->id;
     $body->card->id = $suite->getJobEntity()->id;
     $body->card->url = $jobUrl;
     $body->card->description = new \stdClass();
     $body->card->description->format = 'html';
     $body->card->description->value = $suite->getName() . ' completed in ' . $suite->getJobEntity()->getDuration() . ' seconds. <a href="' . $jobUrl . '">Click for details.</a>';
     return $body;
 }
Esempio n. 3
0
 /**
  * @param Suite $suite
  */
 protected function copySourceCodeFolderToTemporaryFolder(Suite $suite)
 {
     $sourceCodeFolder = dirname($suite->getProject()->getProjectFile());
     exec('cp -r ' . $sourceCodeFolder . ' ' . $this->getTemporaryFolder() . '/source-code');
 }