summaryrefslogtreecommitdiff
path: root/qbuild/rr-build
diff options
context:
space:
mode:
Diffstat (limited to 'qbuild/rr-build')
-rw-r--r--qbuild/rr-build40
1 files changed, 40 insertions, 0 deletions
diff --git a/qbuild/rr-build b/qbuild/rr-build
new file mode 100644
index 00000000..7b54f66b
--- /dev/null
+++ b/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] ?? "local";
+
+// 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