mirror of
git://git.savannah.gnu.org/guix/guix-cuirass.git
synced 2023-12-14 06:03:04 +01:00
Add systemd unit file for remote worker service.
* etc/cuirass-remote-worker.service.in: New file. * doc/cuirass.texi (Build modes): Mention it. * .gitignore: Ignore it. * Makefile.am (systemdservicedir): New variable. (dist_systemdservice_DATA): Likewise. (EXTRA_DIST): Add ‘etc/cuirass-remote-worker.service’. (etc/cuirass-remote-worker.service): New target. * configure.ac: Check for ‘(guix config)’ module. Set and substitute ‘guix_localstatedir’ variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
bc821c8eb9
commit
bef5a7744f
5 changed files with 41 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -24,6 +24,7 @@
|
|||
/config.cache
|
||||
/configure
|
||||
/doc/version.texi
|
||||
/etc/cuirass-remote-worker.service
|
||||
/src/cuirass/config.scm
|
||||
/tests/cache
|
||||
Makefile
|
||||
|
|
|
@ -45,6 +45,7 @@ cssdir = $(staticdir)/css
|
|||
fontsdir = $(staticdir)/fonts
|
||||
imagesdir = $(staticdir)/images
|
||||
jsdir = $(staticdir)/js
|
||||
systemdservicedir = $(libdir)/systemd/system
|
||||
|
||||
dist_pkgmodule_DATA = \
|
||||
src/cuirass/base.scm \
|
||||
|
@ -129,6 +130,9 @@ dist_js_DATA = \
|
|||
src/static/js/jquery-3.3.1.min.js \
|
||||
src/static/js/popper.min.js
|
||||
|
||||
dist_systemdservice_DATA = \
|
||||
etc/cuirass-remote-worker.service
|
||||
|
||||
TEST_EXTENSIONS = .scm .sh
|
||||
AM_TESTS_ENVIRONMENT = \
|
||||
env GUILE_AUTO_COMPILE='0' \
|
||||
|
@ -188,6 +192,7 @@ EXTRA_DIST = \
|
|||
bootstrap \
|
||||
build-aux/guix.scm \
|
||||
src/cuirass/config.scm.in \
|
||||
etc/cuirass-remote-worker.service.in \
|
||||
$(TESTS)
|
||||
|
||||
dist-hook: gen-ChangeLog
|
||||
|
@ -247,6 +252,9 @@ $(bin_SCRIPTS): Makefile
|
|||
$(generate_file); chmod +x $@
|
||||
src/cuirass/config.scm: $(srcdir)/src/cuirass/config.scm.in Makefile
|
||||
$(generate_file)
|
||||
etc/cuirass-remote-worker.service: $(srcdir)/etc/cuirass-remote-worker.service.in \
|
||||
Makefile
|
||||
$(generate_file)
|
||||
|
||||
# Guile modules require 'src/cuirass/config.scm' to exist before their
|
||||
# compilation.
|
||||
|
|
|
@ -47,6 +47,7 @@ GUILE_MODULE_REQUIRED([avahi])
|
|||
GUILE_MODULE_REQUIRED([fibers])
|
||||
GUILE_MODULE_REQUIRED([guix])
|
||||
GUILE_MODULE_REQUIRED([guix git])
|
||||
GUILE_MODULE_REQUIRED([guix config])
|
||||
GUILE_MODULE_REQUIRED([git])
|
||||
GUILE_MODULE_REQUIRED([json])
|
||||
GUILE_MODULE_REQUIRED([mailutils mailutils])
|
||||
|
@ -58,6 +59,9 @@ GUILE_MODULE_REQUIRED([zlib])
|
|||
# We depend on new Guile-Git errors.
|
||||
GUILE_MODULE_REQUIRED_EXPORT([(git)], git-error-message)
|
||||
|
||||
guix_localstatedir="$($GUILE -c '(import (guix config)) (display %localstatedir)')"
|
||||
AC_SUBST(guix_localstatedir)
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
|
||||
[chmod +x pre-inst-env])
|
||||
|
|
|
@ -463,6 +463,19 @@ The easiest way to setup such an infrastructure is to rely on the GNU
|
|||
Guix Cuirass services definitions (@pxref{Continuous Integration,
|
||||
Continuous Integration,, guix, Guix}).
|
||||
|
||||
Alternatively, there is a systemd service unit file installed at
|
||||
@code{$CUIRASS_PREFIX/lib/systemd/system/cuirass-remote-worker.service}
|
||||
to launch the @code{cuirass remote-worker} on systems which use
|
||||
systemd. It can be installed and enabled as follows:
|
||||
|
||||
@example
|
||||
sudo install -o root -g root -m 644 \
|
||||
$CUIRASS_PREFIX/lib/systemd/system/cuirass-remote-worker.service \
|
||||
/etc/systemd/system
|
||||
sudo systemctl enable cuirass-remote-worker.service
|
||||
sudo systemctl start cuirass-remote-worker.service
|
||||
@end example
|
||||
|
||||
@c *********************************************************************
|
||||
@node Invocation
|
||||
@chapter Invocation
|
||||
|
|
15
etc/cuirass-remote-worker.service.in
Normal file
15
etc/cuirass-remote-worker.service.in
Normal file
|
@ -0,0 +1,15 @@
|
|||
# This is a "service unit file" for the systemd init system to launch
|
||||
# 'cuirass remote-worker'. Drop it in /etc/systemd/system or similar
|
||||
# to have 'cuirass remote-worker' automatically started.
|
||||
|
||||
[Unit]
|
||||
Description=Continuous integration remmote worker for GNU Guix
|
||||
|
||||
[Service]
|
||||
ExecStart=@guix_localstatedir@/guix/profiles/per-user/root/guix-profile/bin/cuirass \
|
||||
remote-worker --workers=2 --server=10.0.0.1:5555
|
||||
Environment= LC_ALL=en_US.UTF-8 \
|
||||
'GUIX_LOCPATH=@guix_localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale'
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue