Based on
https://docs.gitlab.com/runner/install/freebsd.html#installing-gitlab-runner
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
.../update/templates/gitlab-runner.j2 | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 guests/playbooks/update/templates/gitlab-runner.j2
diff --git a/guests/playbooks/update/templates/gitlab-runner.j2
b/guests/playbooks/update/templates/gitlab-runner.j2
new file mode 100644
index 0000000..4c40c23
--- /dev/null
+++ b/guests/playbooks/update/templates/gitlab-runner.j2
@@ -0,0 +1,31 @@
+#!/bin/sh
+# PROVIDE: gitlab_runner
+# REQUIRE: DAEMON NETWORKING
+# BEFORE:
+# KEYWORD:
+
+. /etc/rc.subr
+
+name="gitlab_runner"
+rcvar="gitlab_runner_enable"
+
+user="gitlab"
+user_home="/home/gitlab"
+command="/usr/local/bin/gitlab-runner"
+command_args="run --config /etc/gitlab-runner/config.toml"
+pidfile="/var/run/${name}.pid"
+
+start_cmd="gitlab_runner_start"
+
+gitlab_runner_start()
+{
+ export USER=${user}
+ export HOME=${user_home}
+ if checkyesno ${rcvar}; then
+ cd ${user_home}
+ /usr/sbin/daemon -u ${user} -p ${pidfile} ${command} ${command_args} >
/var/log/gitlab-runner.log 2>&1
+ fi
+}
+
+load_rc_config $name
+run_rc_command $1
--
2.25.1