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

Add repeat command
Author: xaizek
Author date (UTC): 2018-02-11 15:56
Committer name: xaizek
Committer date (UTC): 2018-02-11 16:00
Parent(s): 03290a3321eadfc80edd348712ef4607c1d4caaf
Signing key: 99DC5E4DB05F6BE2
Tree: 252439f803340e7d98a93b3c797e591931537d87
File Lines added Lines deleted
new.php 23 5
File new.php changed (mode: 100644) (index cdc197e..b757648)
... ... if (sizeof($argv) < 3) {
25 25
26 26 $name = $argv[1]; $name = $argv[1];
27 27 $revision = $argv[2]; $revision = $argv[2];
28 $builders = array_slice($argv, 3);
28 29
29 30 if (substr($name, 0, strlen('fragile/')) === 'fragile/') { if (substr($name, 0, strlen('fragile/')) === 'fragile/') {
30 31 $command = substr($name, strlen('fragile/')); $command = substr($name, strlen('fragile/'));
31 switch ($command) {
32 $pieces = explode('%', $command);
33 switch ($pieces[0]) {
32 34 case 'clean': case 'clean':
33 35 // XXX: ideally, this would only schedule the operation for the // XXX: ideally, this would only schedule the operation for the
34 36 // daemon; currently, we can change FS in parallel with it // daemon; currently, we can change FS in parallel with it
35 37 Utils::delTree(BUILDS_PATH); Utils::delTree(BUILDS_PATH);
36 38 exit("Cleaned ".BUILDS_PATH); exit("Cleaned ".BUILDS_PATH);
39 case 'repeat':
40 if (sizeof($pieces) != 2) {
41 die('repeat command expects an argument');
42 }
43
44 $buildset = Buildset::get($pieces[1]);
45 if ($buildset === null) {
46 die("repeat command expects a valid buildset id as an ".
47 "argument\ngot: ${pieces[1]}");
48 }
49
50 $name = $buildset->name;
51 $revision = $buildset->revision;
52 $builders = [];
53
54 print "Repeating $name@$revision from #{$pieces[1]}\n";
55 break;
37 56
38 57 default: default:
39 exit("Unknown command: .$command");
58 exit("Unknown command: $command");
40 59 } }
41 60 } }
42 61
43 62 $buildset = Buildset::create($name, $revision); $buildset = Buildset::create($name, $revision);
44 63
45 if (sizeof($argv) > 3) {
46 $builders = scheduleBuilders($buildset, BUILDERS_PATH,
47 array_slice($argv, 3));
64 if (!empty($builders)) {
65 $builders = scheduleBuilders($buildset, BUILDERS_PATH, $builders);
48 66 } else { } else {
49 67 $builders = scheduleBuildersIn($buildset, BUILDERS_PATH, ''); $builders = scheduleBuildersIn($buildset, BUILDERS_PATH, '');
50 68 $builders = array_merge($builders, $builders = array_merge($builders,
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