v0.3.0-2
This commit is contained in:
@@ -77,7 +77,7 @@ container:
|
||||
# If it's empty, act_runner will find an available docker host automatically.
|
||||
# If it's "-", act_runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers.
|
||||
# If it's not empty or "-", the specified docker host will be used. An error will be returned if it doesn't work.
|
||||
docker_host: ""
|
||||
docker_host: unix:///run/gitea-runner/podman/podman.sock
|
||||
# Pull docker image(s) even if already present
|
||||
force_pull: false
|
||||
|
||||
|
||||
@@ -14,18 +14,8 @@ fi
|
||||
mkdir -p "$RUNNER_DIR"
|
||||
chown gitea-runner:gitea-runner "$RUNNER_DIR"
|
||||
|
||||
mkdir -p "$RUNNER_DIR"
|
||||
chown gitea-runner:gitea-runner "$RUNNER_DIR"
|
||||
|
||||
# Enable rootless podman socket (once per user, idempotent)
|
||||
RUNNER_HOME=$(getent passwd gitea-runner | cut -d: -f6)
|
||||
SOCKET_WANTS="${RUNNER_HOME}/.config/systemd/user/sockets.target.wants"
|
||||
PODMAN_SOCKET="/usr/lib/systemd/user/podman.socket"
|
||||
if [ -f "$PODMAN_SOCKET" ] && [ ! -L "${SOCKET_WANTS}/podman.socket" ]; then
|
||||
mkdir -p "$SOCKET_WANTS"
|
||||
ln -s "$PODMAN_SOCKET" "${SOCKET_WANTS}/podman.socket"
|
||||
chown -R gitea-runner:gitea-runner "${RUNNER_HOME}/.config"
|
||||
fi
|
||||
# Ensure Podman API socket is running
|
||||
systemctl enable --now gitea-runner-podman.service
|
||||
|
||||
cd "$RUNNER_DIR"
|
||||
sudo -u gitea-runner gitea-act-runner register -c "$CONFIG"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: gitea-act_runner
|
||||
Version: 0.3.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Gitea act runner service.
|
||||
License: MIT
|
||||
Group: System Environment/Base
|
||||
@@ -12,9 +12,11 @@ Source10: gitea-act_runner@.service
|
||||
Source11: config.yaml
|
||||
Source12: gitea-act-runner-setup
|
||||
Source13: gitea-act-runner.sysusers
|
||||
Source14: gitea-runner-podman.service
|
||||
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: shadow-utils
|
||||
Requires: podman
|
||||
%{?systemd_requires}
|
||||
|
||||
ExclusiveArch: x86_64 aarch64
|
||||
@@ -37,6 +39,7 @@ install -m 755 %{SOURCE1} %{buildroot}%{_bindir}/gitea-act-runner
|
||||
%endif
|
||||
|
||||
install -p -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/gitea-act_runner@.service
|
||||
install -p -D -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/gitea-runner-podman.service
|
||||
install -p -D -m 644 %{SOURCE13} %{buildroot}%{_sysusersdir}/gitea-act-runner.conf
|
||||
|
||||
install -d -m 750 %{buildroot}%{_sysconfdir}/gitea/runners
|
||||
@@ -61,12 +64,15 @@ if ! grep -q "gitea-runner" /etc/subuid; then
|
||||
fi
|
||||
|
||||
%systemd_post gitea-act_runner@.service
|
||||
%systemd_post gitea-runner-podman.service
|
||||
|
||||
%preun
|
||||
%systemd_preun gitea-act_runner@.service
|
||||
%systemd_preun gitea-runner-podman.service
|
||||
|
||||
%postun
|
||||
%systemd_postun gitea-act_runner@.service
|
||||
%systemd_postun gitea-runner-podman.service
|
||||
|
||||
%clean
|
||||
%{__rm} -rf %{buildroot}
|
||||
@@ -77,9 +83,14 @@ fi
|
||||
%{_bindir}/gitea-act-runner
|
||||
%{_bindir}/gitea-act-runner-setup
|
||||
%{_unitdir}/gitea-act_runner@.service
|
||||
%{_unitdir}/gitea-runner-podman.service
|
||||
%{_sysusersdir}/gitea-act-runner.conf
|
||||
|
||||
%defattr(-,gitea-runner,gitea-runner,750)
|
||||
%dir %{_sysconfdir}/gitea
|
||||
%dir %{_sysconfdir}/gitea/runners
|
||||
%config(noreplace) %{_sysconfdir}/gitea/runners/runner1.yaml
|
||||
|
||||
%changelog
|
||||
* Mon Mar 17 2025 Zoran Pericic <zpericic@netst.org> - 0.3.0-2
|
||||
- Add gitea-runner-podman.service for rootless Podman API socket
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=Act runner is a runner for Gitea
|
||||
After=network.target
|
||||
ConditionPathExists=/var/lib/gitea/runners/%I/.runner
|
||||
ConditionPathExists=/var/lib/gitea/runners/%i/.runner
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=3
|
||||
|
||||
@@ -11,10 +11,10 @@ User=gitea-runner
|
||||
|
||||
StateDirectory=gitea/runners/%i
|
||||
StateDirectoryMode=0750
|
||||
WorkingDirectory=/var/lib/gitea/runners/%I
|
||||
Environment=HOME=/var/lib/gitea/runners/%I
|
||||
WorkingDirectory=/var/lib/gitea/runners/%i
|
||||
Environment=HOME=/var/lib/gitea/runners/%i
|
||||
|
||||
ExecStart=/usr/bin/gitea-act-runner daemon -c /etc/gitea/runners/%I.yaml
|
||||
ExecStart=/usr/bin/gitea-act-runner daemon -c /etc/gitea/runners/%i.yaml
|
||||
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
14
gitea-runner-podman.service
Normal file
14
gitea-runner-podman.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Podman API socket for Gitea Act Runner
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=gitea-runner
|
||||
RuntimeDirectory=gitea-runner/podman
|
||||
ExecStart=/usr/bin/podman system service --time=0 unix:///run/gitea-runner/podman/podman.sock
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user