File INSTALL.md changed (mode: 100644) (index 8c2fc2f..4310863) |
... |
... |
Before installing files, copy `config.php.sample` to `config.php` and fill in |
15 |
15 |
all the values of according to comments there. This file holds configuration of |
all the values of according to comments there. This file holds configuration of |
16 |
16 |
both web and daemon parts and should be kept in sync between the two parts. |
both web and daemon parts and should be kept in sync between the two parts. |
17 |
17 |
|
|
|
18 |
|
See `hooks/` directory and `README` file there for instructions on using hooks. |
|
19 |
|
|
18 |
20 |
## Installation ## |
## Installation ## |
19 |
21 |
|
|
20 |
22 |
Run the `install` script to perform the installation: |
Run the `install` script to perform the installation: |
|
... |
... |
build. When script is run: |
37 |
39 |
Use dummy builders from `builders/` directory during setup to check |
Use dummy builders from `builders/` directory during setup to check |
38 |
40 |
web-interface isolated from actual build process. |
web-interface isolated from actual build process. |
39 |
41 |
|
|
|
42 |
|
#### Conditional builders #### |
|
43 |
|
|
|
44 |
|
In addition to `<web-path>/builders` directory builders from |
|
45 |
|
`<web-path>/builders/<name>` (where `<name>` is branch name probably) are also |
|
46 |
|
scheduled, if that directory exists. This can be used to run some builders only |
|
47 |
|
for specific branches. |
|
48 |
|
|
40 |
49 |
### Scheduling a build ### |
### Scheduling a build ### |
41 |
50 |
|
|
42 |
51 |
Run `new.php` passing it refname and revision ID (in this order) to work with. |
Run `new.php` passing it refname and revision ID (in this order) to work with. |
File new.php changed (mode: 100644) (index 629461d..2f4f0a0) |
... |
... |
$revision = $argv[2]; |
27 |
27 |
|
|
28 |
28 |
$buildset = Buildset::create($name, $revision); |
$buildset = Buildset::create($name, $revision); |
29 |
29 |
|
|
30 |
|
$builders = []; |
|
31 |
|
|
|
32 |
|
if ($handle = opendir(BUILDERS_PATH)) { |
|
33 |
|
while (($entry = readdir($handle)) !== false) { |
|
34 |
|
if ($entry != '.' && $entry != '..') { |
|
35 |
|
Build::create($buildset, $entry); |
|
36 |
|
array_push($builders, $entry); |
|
37 |
|
} |
|
38 |
|
} |
|
39 |
|
|
|
40 |
|
closedir($handle); |
|
41 |
|
} |
|
|
30 |
|
$builders = scheduleBuilders($buildset, BUILDERS_PATH, ''); |
|
31 |
|
$builders = array_merge($builders, |
|
32 |
|
scheduleBuilders($buildset, BUILDERS_PATH, "$name/")); |
42 |
33 |
|
|
43 |
34 |
print "Buildset ID: $buildset->buildsetid\n"; |
print "Buildset ID: $buildset->buildsetid\n"; |
44 |
35 |
if (sizeof($builders) == 0) { |
if (sizeof($builders) == 0) { |
|
... |
... |
if (sizeof($builders) == 0) { |
49 |
40 |
. ": " . join(', ', $builders) . "\n"; |
. ": " . join(', ', $builders) . "\n"; |
50 |
41 |
} |
} |
51 |
42 |
|
|
|
43 |
|
/** |
|
44 |
|
* @brief Schedules builders discovered in @p dir directory. |
|
45 |
|
* |
|
46 |
|
* @param buildset Parent buildset for newly created builds. |
|
47 |
|
* @param dir Directory to look for builders. |
|
48 |
|
* @param suffix Additional suffix for builders path (appended to @p dir). |
|
49 |
|
* |
|
50 |
|
* @returns Array of scheduler builder names. |
|
51 |
|
*/ |
|
52 |
|
function scheduleBuilders($buildset, $dir, $suffix) |
|
53 |
|
{ |
|
54 |
|
$builders = []; |
|
55 |
|
$basePath = "$dir/$suffix"; |
|
56 |
|
if (is_dir($basePath) && $handle = opendir($basePath)) { |
|
57 |
|
while (($entry = readdir($handle)) !== false) { |
|
58 |
|
$path = "$basePath/$entry"; |
|
59 |
|
if (!is_dir($path) && $entry != '.' && $entry != '..') { |
|
60 |
|
$builderName = "$suffix$entry"; |
|
61 |
|
Build::create($buildset, $builderName); |
|
62 |
|
array_push($builders, $builderName); |
|
63 |
|
} |
|
64 |
|
} |
|
65 |
|
|
|
66 |
|
closedir($handle); |
|
67 |
|
} |
|
68 |
|
return $builders; |
|
69 |
|
} |
|
70 |
|
|
52 |
71 |
?> |
?> |