diff options
author | Wolfy-J <[email protected]> | 2019-01-11 15:48:44 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-01-11 15:48:44 +0300 |
commit | 1e12b6ded87f8a89bf1cc88943cdba41ad4da8ed (patch) | |
tree | c8768ad398d9fa45f781c62cc91ec305cded2d7c /quickbuild/build.php | |
parent | 5b24b65e62a26f74b9f9bd9ee79c717ea0836892 (diff) |
quickbuilds
Diffstat (limited to 'quickbuild/build.php')
-rw-r--r-- | quickbuild/build.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/quickbuild/build.php b/quickbuild/build.php new file mode 100644 index 00000000..63bd1460 --- /dev/null +++ b/quickbuild/build.php @@ -0,0 +1,39 @@ +<?php +/** + * Automatic roadrunner builds. + */ + +use Spiral\RoadRunner\QuickBuild\Builder; + +require_once "src/Builder.php"; + +// load build config +$version = $argv[1] ?? "quickbuild"; + +// load build config +$config = $argv[2] ?? __DIR__ . "/.build.json"; + +// Greeting! +Builder::cprintf( + "Building <green>RoadRunner</reset> specifically for you (version: <white>%s</reset>)...\n", + $version +); + +$builder = Builder::loadConfig($config); +if ($builder == null) { + Builder::cprintf("<red>Unable to load config:</reset> %s\n", $config); + return; +} + +$errors = $builder->configErrors(); +if (!empty($errors)) { + Builder::cprintf("<yellow>Found configuration errors:</reset>\n"); + foreach ($errors as $error) { + Builder::cprintf("- <red>%s</reset>\n", $error); + } + + return; +} + +// Start build +$builder->build(getcwd(), __DIR__ . '/main.go', 'rr', $version);
\ No newline at end of file |