Beispiel #1
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;
 }
 /**
  * @param Suite $suite
  */
 protected function copySourceCodeFolderToTemporaryFolder(Suite $suite)
 {
     $sourceCodeFolder = dirname($suite->getProject()->getProjectFile());
     exec('cp -r ' . $sourceCodeFolder . ' ' . $this->getTemporaryFolder() . '/source-code');
 }