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

Run builds in the order in which they appear
On the dashboard.

This extends Builds::builderCmp() to account for buildset ID, which
shouldn't affect sorting for the dashboard.
Author: xaizek
Author date (UTC): 2017-07-03 10:52
Committer name: xaizek
Committer date (UTC): 2017-07-08 13:32
Parent(s): 9bfc7ad82bd0cf4f7826d08de8c279142d115df1
Signing key: 99DC5E4DB05F6BE2
Tree: 762b7219ef08c50f61b06e682bec130abe4f8e45
File Lines added Lines deleted
classes/Builds.php 6 0
daemon.php 7 2
File classes/Builds.php changed (mode: 100644) (index 765093b..6c7098b)
... ... class Builds
132 132 */ */
133 133 public static function builderCmp($a, $b) public static function builderCmp($a, $b)
134 134 { {
135 // buildset IDs are the primary key
136 if ($a->buildset != $b->buildset) {
137 return $a->buildset - $b->buildset;
138 }
139
140 // builder name is the secondary key
135 141 $condA = (strpos($a, '/') !== false); $condA = (strpos($a, '/') !== false);
136 142 $condB = (strpos($b, '/') !== false); $condB = (strpos($b, '/') !== false);
137 143 if ($condA ^ $condB) { if ($condA ^ $condB) {
File daemon.php changed (mode: 100644) (index 7fbe0de..ea2cee1)
... ... function serve()
83 83 */ */
84 84 function runBuilds($builds) function runBuilds($builds)
85 85 { {
86 // TODO: sort $builds according to $build->$buildset and then by
87 // $build->buildername same way as it's done for the dashboard
86 $builders = [];
88 87 foreach ($builds as $build) { foreach ($builds as $build) {
88 $builders[$build->buildername] = $build;
89 }
90 // sort builders by their name
91 uksort($builders, "Builds::builderCmp");
92
93 foreach ($builders as $build) {
89 94 $buildset = Buildset::get($build->buildset); $buildset = Buildset::get($build->buildset);
90 95
91 96 if (!putenv('FRAGILE_REF=' . $buildset->name)) { if (!putenv('FRAGILE_REF=' . $buildset->name)) {
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