Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit ccac8c4

Browse files
committed
Added systemd unit for gitlab-runner #2582
1 parent 473e207 commit ccac8c4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tools.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,35 @@ tools:
22582258
x86_64: https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v${version}/downloads/binaries/gitlab-runner-linux-${alt_arch}
22592259
type: executable
22602260
path: ${target}/bin/gitlab-runner
2261+
files:
2262+
- path: ${prefix}/etc/systemd/system/gitlab-runner.service
2263+
content: |
2264+
[Unit]
2265+
Description=GitLab Runner
2266+
After=syslog.target network.target
2267+
[Service]
2268+
StartLimitInterval=5
2269+
StartLimitBurst=10
2270+
ExecStart=/usr/local/bin/gitlab-runner "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "gitlab-runner"
2271+
Restart=always
2272+
RestartSec=120
2273+
EnvironmentFile=-/etc/sysconfig/gitlab-runner
2274+
[Install]
2275+
WantedBy=multi-user.target
2276+
- path: ${prefix}/etc/gitlab-runner/config.toml
2277+
content: |
2278+
concurrent = 1
2279+
check_interval = 0
2280+
2281+
[session_server]
2282+
session_timeout = 1800
2283+
post_install: |
2284+
echo "Patch systemd unit"
2285+
sed -i "s|ExecStart=/usr/local/bin/gitlab-runner|${relative_target}/bin/gitlab-runner|g" "${prefix}/etc/systemd/system/gitlab-runner.service"
2286+
if test -z "${prefix}" && has_systemd; then
2287+
echo "Reload systemd"
2288+
systemctl daemon-reload
2289+
fi
22612290
22622291
- name: gitsign
22632292
version: 0.2.0

0 commit comments

Comments
 (0)