aboutsummaryrefslogtreecommitdiff
path: root/bbot/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-03 15:54:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-03 15:54:25 +0200
commit798a0aab2fbb5aed01bbd8419b65a03fb4602b3f (patch)
tree480c89c64c5113cc015934a82d03e0dc45ed5c67 /bbot/buildfile
parentc13366d910ebbdfc30c8b399ff29161747537d1c (diff)
Make agent simple systemd daemon, add worker stub
Diffstat (limited to 'bbot/buildfile')
-rw-r--r--bbot/buildfile49
1 files changed, 41 insertions, 8 deletions
diff --git a/bbot/buildfile b/bbot/buildfile
index bcd0b93..c2d5d05 100644
--- a/bbot/buildfile
+++ b/bbot/buildfile
@@ -2,17 +2,49 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
+# Systemd .service file.
+#
+# @@ Currently the executable path is hardcoded as /usr/bin/bbot-agent. To
+# handle this properly would need to generate/pre-process it )and detect
+# update for install).
+#
+define service: file
+service{*}: extension = service
+service{*}: install = lib/systemd/system/
+service{*}: install.mode = 644
+
import libs = libbutl%lib{butl}
import libs += libbbot%lib{bbot}
-exe{bbot-agent}: \
-{ cxx}{ agent } {hxx ixx cxx}{ agent-options } \
- {hxx ixx cxx}{ common-options } \
-{hxx cxx}{ diagnostics } \
-{hxx }{ types } \
-{hxx cxx}{ types-parsers } \
-{hxx cxx}{ utility } \
-{hxx }{ version-impl } \
+# Agent is a systemd service.
+#
+# @@ Have to package on Linux.
+#
+if ($cxx.target.class == "linux")
+{
+ ./: exe{bbot-agent} service{'bbot-agent@'}
+
+ exe{bbot-agent}: \
+ { cxx}{ agent } {hxx ixx cxx}{ agent-options } \
+ {hxx ixx cxx}{ common-options } \
+ {hxx cxx}{ diagnostics } \
+ {hxx }{ types } \
+ {hxx cxx}{ types-parsers } \
+ {hxx cxx}{ utility } \
+ {hxx }{ version-impl } \
+ $libs
+}
+
+./: exe{bbot-worker}
+
+exe{bbot-worker}: \
+{ cxx}{ worker } {hxx ixx cxx}{ worker-options } \
+ {hxx ixx cxx}{ common-options } \
+{hxx cxx}{ diagnostics } \
+{hxx }{ types } \
+{hxx cxx}{ types-parsers } \
+{hxx cxx}{ utility } \
+{hxx }{ version-impl } \
$libs
# Generated options parser.
@@ -21,6 +53,7 @@ if $cli.configured
{
cli.cxx{common-options}: cli{common}
cli.cxx{agent-options}: cli{agent}
+ cli.cxx{worker-options}: cli{worker}
cli.options += -I $src_root --include-with-brackets --include-prefix bbot \
--guard-prefix BBOT --cxx-prologue "#include <bbot/types-parsers>" \