Esempio n. 1
0
 protected function getPlaceholders(Commit $commit)
 {
     $project = $commit->getProject();
     return array('%slug%' => $project->getSlug(), '%name%' => $project->getName(), '%status%' => $commit->getStatus(), '%status_code%' => $commit->getStatusCode(), '%STATUS%' => strtoupper($commit->getStatus()), '%sha%' => $commit->getSha(), '%short_sha%' => $commit->getShortSha(), '%author%' => $commit->getAuthor(), '%message%' => $commit->getMessage());
 }
Esempio n. 2
0
 public function updateCommit(Commit $commit)
 {
     $stmt = $this->db->prepare('UPDATE `commit` SET status = :status, output = :output, build_date = CURRENT_TIMESTAMP WHERE slug = :slug AND sha = :sha');
     $stmt->bindValue(':slug', $commit->getProject()->getSlug(), SQLITE3_TEXT);
     $stmt->bindValue(':sha', $commit->getSha(), SQLITE3_TEXT);
     $stmt->bindValue(':status', $commit->getStatusCode(), SQLITE3_TEXT);
     $stmt->bindValue(':output', $commit->getOutput(), SQLITE3_TEXT);
     if (false === $stmt->execute()) {
         // @codeCoverageIgnoreStart
         throw new \RuntimeException(sprintf('Unable to save build "%s@%s".', $commit->getProject()->getName(), $commit->getSha()));
         // @codeCoverageIgnoreEnd
     }
 }
Esempio n. 3
0
 public function notify(Commit $commit)
 {
     $this->register();
     return $this->doNotify($commit->isSuccessful() ? 'Success' : 'Fail', $commit->getProject()->getName(), $this->format($this->format, $commit));
 }