summaryrefslogtreecommitdiff
path: root/dev-util/gitlab-runner/files
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/gitlab-runner/files')
-rw-r--r--dev-util/gitlab-runner/files/gitlab-runner.confd19
-rw-r--r--dev-util/gitlab-runner/files/gitlab-runner.initd38
-rw-r--r--dev-util/gitlab-runner/files/gitlab-runner.service18
-rw-r--r--dev-util/gitlab-runner/files/gitlab-runner.tmpfile1
4 files changed, 76 insertions, 0 deletions
diff --git a/dev-util/gitlab-runner/files/gitlab-runner.confd b/dev-util/gitlab-runner/files/gitlab-runner.confd
new file mode 100644
index 000000000000..513b2f9cef18
--- /dev/null
+++ b/dev-util/gitlab-runner/files/gitlab-runner.confd
@@ -0,0 +1,19 @@
+# config file for /etc/init.d/gitlab-runner
+# The convention is that the defaults are shown here, commented out.
+# Do not override these unless you know exactly what you are doing.
+
+# runner_config="/etc/gitlab-runner/config.toml"
+# runner_datadir="/var/lib/gitlab-runner"
+# runner_service="${RC_SVCNAME}"
+# runner_user="gitlab-runner"
+
+# Additional options
+# run /usr/bin/gitlab-runner -h to see available options
+# --config, --user, --service and --working-directory are set by the
+# above variables, so do not add them here.
+# RUNNER_OPTS=""
+
+# Logging
+# runner_logdir="/var/log/gitlab-runner"
+# output_log="${runner_logdir}/gitlab-runner.log"
+# error_log="${runner_logdir}/error.log"
diff --git a/dev-util/gitlab-runner/files/gitlab-runner.initd b/dev-util/gitlab-runner/files/gitlab-runner.initd
new file mode 100644
index 000000000000..0e5c5ed224b6
--- /dev/null
+++ b/dev-util/gitlab-runner/files/gitlab-runner.initd
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/gitlab-runner"
+runner_datadir="${runner_datadir:-/var/lib/gitlab-runner}"
+command_args="run
+ --config ${runner_config:-/etc/gitlab-runner/config.toml}
+ --service ${runner_service:-${RC_SVCNAME}}
+ --user ${runner_user:-gitlab-runner}
+ --working-directory ${runner_datadir}
+ ${RUNNER_OPTS}"
+command_background=true
+extra_started_commands="reload"
+name="${name:-GitLab Runner}"
+pidfile="/run/${RC_SVCNAME}.pid"
+runner_user="${runner_user:-gitlab-runner}"
+runner_logdir="${runner_logdir:-/var/log/gitlab-runner}"
+output_log="${output_log:-${runner_logdir}/gitlab-runner.log}"
+error_log="${error_log:-${runner_logdir}/gitlab-runner.err}"
+retry="QUIT/60/TERM/60"
+required_files="${runner_config}"
+
+depend() {
+ need localmount
+ after net.lo loopback
+}
+
+start_pre() {
+ checkpath -d -m 0700 -o "${runner_user}" "${runner_datadir}"
+ checkpath -d -m 0750 -o "${runner_user}" "${runner_logdir}"
+}
+
+reload() {
+ ebegin "Reloading ${name} configuration"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $? "Failed to reload ${name}"
+}
diff --git a/dev-util/gitlab-runner/files/gitlab-runner.service b/dev-util/gitlab-runner/files/gitlab-runner.service
new file mode 100644
index 000000000000..047de5cc7363
--- /dev/null
+++ b/dev-util/gitlab-runner/files/gitlab-runner.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=GitLab Runner service
+After=syslog.target network.target
+ConditionFileIsExecutable=/usr/bin/gitlab-runner
+
+[Service]
+StartLimitInterval=5
+StartLimitBurst=10
+ExecStart=/usr/bin/gitlab-runner run -c /etc/gitlab-runner/config.toml -u gitlab-runner -d /var/lib/gitlab-runner --syslog
+Restart=always
+RestartSec=120
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=gitlab-runner
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-util/gitlab-runner/files/gitlab-runner.tmpfile b/dev-util/gitlab-runner/files/gitlab-runner.tmpfile
new file mode 100644
index 000000000000..40453089f869
--- /dev/null
+++ b/dev-util/gitlab-runner/files/gitlab-runner.tmpfile
@@ -0,0 +1 @@
+d /run/gitlab-runner 0755 gitlab-runner gitlab-runner