Combine scouting webserver and scouting web pages
This patch adds a new `//scouting` target that runs the webserver and
points it at our web pages. This will be the target that folks can use
to run the entire scouting application.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I62acfb271b856f9d238b17ecc3573f31a07bab41
diff --git a/scouting/BUILD b/scouting/BUILD
index 836e5c3..9b8adee 100644
--- a/scouting/BUILD
+++ b/scouting/BUILD
@@ -1,4 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+load("//tools/build_rules:js.bzl", "turn_files_into_runfiles")
go_binary(
name = "sql_demo",
@@ -15,3 +16,31 @@
visibility = ["//visibility:private"],
deps = ["@com_github_mattn_go_sqlite3//:go-sqlite3"],
)
+
+turn_files_into_runfiles(
+ name = "main_bundle_compiled_runfiles",
+ files = "//scouting/www:main_bundle_compiled",
+)
+
+sh_binary(
+ name = "scouting",
+ srcs = [
+ "scouting.sh",
+ ],
+ data = [
+ ":main_bundle_compiled_runfiles",
+ "//scouting/webserver",
+ "//scouting/www:index.html",
+ "//scouting/www:zonejs_copy",
+ ],
+)
+
+py_test(
+ name = "scouting_test",
+ srcs = [
+ "scouting_test.py",
+ ],
+ data = [
+ ":scouting",
+ ],
+)