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

Set $FRAGILE_REF for builders
Author: xaizek
Author date (UTC): 2017-04-01 12:28
Committer name: xaizek
Committer date (UTC): 2017-04-01 12:30
Parent(s): fe037b52ba2ef3938105c5ae90239b505d86fd49
Signing key: 99DC5E4DB05F6BE2
Tree: 822b96b9c02bc7e863ab68e57bdd37d71fd0b3a8
File Lines added Lines deleted
INSTALL.md 1 0
daemon.php 7 0
File INSTALL.md changed (mode: 100644) (index 675d9ce..5be2d66)
... ... build. When script is run:
32 32
33 33 * `$FRAGILE_REPO` environment variable points to location of checked out * `$FRAGILE_REPO` environment variable points to location of checked out
34 34 repository; repository;
35 * `$FRAGILE_REF` environment variable is set to the name of reference of VCS;
35 36 * current directory is build directory. * current directory is build directory.
36 37
37 38 Use dummy builders from `builders/` directory during setup to check Use dummy builders from `builders/` directory during setup to check
File daemon.php changed (mode: 100644) (index c359e70..7fbe0de)
14 14 // along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
15 15
16 16 require_once __DIR__ . '/classes/Builds.php'; require_once __DIR__ . '/classes/Builds.php';
17 require_once __DIR__ . '/classes/Buildset.php';
17 18 require_once __DIR__ . '/config.php'; require_once __DIR__ . '/config.php';
18 19
19 20 // TODO: maybe mark all "running" builds as failed // TODO: maybe mark all "running" builds as failed
 
... ... function runBuilds($builds)
85 86 // TODO: sort $builds according to $build->$buildset and then by // TODO: sort $builds according to $build->$buildset and then by
86 87 // $build->buildername same way as it's done for the dashboard // $build->buildername same way as it's done for the dashboard
87 88 foreach ($builds as $build) { foreach ($builds as $build) {
89 $buildset = Buildset::get($build->buildset);
90
91 if (!putenv('FRAGILE_REF=' . $buildset->name)) {
92 die("Failed to set FRAGILE_REF environment variable\n");
93 }
94
88 95 // checkout revision // checkout revision
89 96 system(__DIR__ . "/vcs/checkout '" . $build->revision . "'", $retval); system(__DIR__ . "/vcs/checkout '" . $build->revision . "'", $retval);
90 97 if ($retval != 0) { if ($retval != 0) {
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