summaryrefslogtreecommitdiff
path: root/src/qbuild/rr-build
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-02 17:17:16 +0300
committerWolfy-J <[email protected]>2019-05-02 17:17:16 +0300
commit7bd5da5327e0d6f602627006d55cf803b8c4a4c7 (patch)
tree2e76fba4b391e2733a6e59c8149bb22f6c91dfbc /src/qbuild/rr-build
parent859441b4d084babca70266bd23ceb2a95269b3ff (diff)
fixing tests
Diffstat (limited to 'src/qbuild/rr-build')
-rw-r--r--src/qbuild/rr-build40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/qbuild/rr-build b/src/qbuild/rr-build
new file mode 100644
index 00000000..7918f4f8
--- /dev/null
+++ b/src/qbuild/rr-build
@@ -0,0 +1,40 @@
+#!/usr/bin/env php
+<?php
+/**
+ * Automatic roadrunner builds.
+ */
+
+use Spiral\RoadRunner\QuickBuild\Builder;
+
+require_once "src/Builder.php";
+
+// load build config
+$version = $argv[1] ?? "1.3.1";
+
+// 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