xaizek / fragile (License: AGPLv3+) (since 2018-12-07)
Simple lightweight CI, attempting to be somewhat Unix-like in its philosophy.
Commit 77af52aecb535bd2a915477e29a5641349239604

Change Build::{setStatus => markAsStarted}()
Author: xaizek
Author date (UTC): 2018-11-23 10:23
Committer name: xaizek
Committer date (UTC): 2018-11-23 10:27
Parent(s): 4f55cfb0ee2d3e70d46ac2e342d25c84c6dfe9f2
Signing key: 99DC5E4DB05F6BE2
Tree: e89ea54295a8169ccb47dcdc82969ce3323e98cb
File Lines added Lines deleted
classes/Build.php 5 7
daemon.php 1 1
File classes/Build.php changed (mode: 100644) (index f4cef89..8dfb9d8)
... ... class Build
111 111 } }
112 112
113 113 /** /**
114 * @brief Updates status of the build.
115 *
116 * @param status New status string.
114 * @brief Updates the build to indicate that it has been started.
117 115 */ */
118 public function setStatus($status)
116 public function markAsStarted()
119 117 { {
120 $sql = 'UPDATE builds SET status = ? '
118 $sql = 'UPDATE builds SET status = "running" '
121 119 . 'WHERE buildset = ? AND buildername = ?'; . 'WHERE buildset = ? AND buildername = ?';
122 120 $statement = DB::prepare($sql); $statement = DB::prepare($sql);
123 121 if (!$statement || if (!$statement ||
124 $statement->execute([$status, $this->buildset,
122 $statement->execute([$this->buildset,
125 123 $this->buildername]) === false) { $this->buildername]) === false) {
126 die("Failed to set build status to 'running'\n"
124 die("Failed to mark build as started\n"
127 125 . print_r(DB::errorInfo(), true)); . print_r(DB::errorInfo(), true));
128 126 } }
129 127
File daemon.php changed (mode: 100644) (index af76e90..da451f9)
... ... function runBuild($build)
133 133 { {
134 134 // TODO: measure and record execution time of the build // TODO: measure and record execution time of the build
135 135
136 $build->setStatus('running');
136 $build->markAsStarted();
137 137
138 138 $rawOutput = ''; $rawOutput = '';
139 139
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/fragile

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/fragile

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master