Add a /etc directory for the root dockerd setup

Also don't show the post install advice when upgrading
This commit is contained in:
2025-01-23 15:11:10 +01:00
parent 3909595b8e
commit 03b2910573
2 changed files with 15 additions and 14 deletions
+2 -3
View File
@@ -63,7 +63,6 @@ You can also configure the runner with a configuration file.
The configuration file is a YAML file, you can generate a sample configuration file with `./act_runner generate-config`.
```bash
mkdir -p 0750 /etc/gitea-act-runner/
./act_runner generate-config > /etc/gitea-act-runner/config.yaml
chmod 0640 /etc/gitea-act-runner/config.yaml
```
@@ -71,8 +70,8 @@ chmod 0640 /etc/gitea-act-runner/config.yaml
You can specify the configuration file path with `-c`/`--config` argument.
```bash
./act_runner -c config.yaml register # register with config file
./act_runner -c config.yaml daemon # run with config file
./act_runner -c /etc/gitea-act-runner/config.yaml register # register with config file
./act_runner -c /etc/gitea-act-runner/config.yaml daemon # run with config file
```
You can read the latest version of the configuration file online at [config.example.yaml](internal/pkg/config/config.example.yaml).
+13 -11
View File
@@ -16,7 +16,7 @@ A runner for Gitea based on act.}
Name: gitea-act-runner
Version: 0.2.10
Release: %autorelease -b 6
Release: %autorelease -b 7
Summary: A runner for Gitea based on act.
%global act_runner_service %{name}.service
@@ -91,15 +91,17 @@ fi
%post %{dockerd_rootless}
%systemd_user_post %{act_runner_rootless_service} %{dockerd_rootless_service}
loginctl enable-linger %{runner_user_rootless}
echo Please read README.%{rootless}-%{dockerd}.md to finish the installation
if [ $1 -eq 1 ] || [ ! -d /home/%{runner_user_rootless}/act_runner ]; then
echo ' INFO Please read README.%{rootless}-%{dockerd}.md to finish the installation'
fi
%preun %{dockerd_rootless}
loginctl disable-linger %{runner_user_rootless}
%systemd_user_preun %{dockerd_rootless_service} %{act_runner_rootless_service}
loginctl disable-linger %{runner_user_rootless}
%postun %{dockerd_rootless}
if [ $1 -eq 0 ]; then
userdel -rZf %{runner_user_rootless}
userdel -rf %{runner_user_rootless}
fi
%prep
@@ -110,19 +112,18 @@ fi
go build %{gobuild_baseflags} -o bin/%{act_runner_bin} %{goipath}
%install
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vd %{buildroot}%{_unitdir}
install -m 0755 -vd %{buildroot}%{_userunitdir}
install -m 0755 -vd %{buildroot}%{_docdir}/%{name}
install -m 0755 -vd %{buildroot}%{_datadir}/%{name}
# The binary
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp bin/* %{buildroot}%{_bindir}
# dockerd
install -m 0755 -vd %{buildroot}%{_unitdir}
install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name}
install -D -m 0644 -vp %{SOURCE1} %{buildroot}%{_unitdir}/%{act_runner_service}
# Rootless dockerd
# dockerd-rootless
install -m 0755 -vd %{buildroot}%{_userunitdir}
install -m 0755 -vd %{buildroot}%{_datadir}/%{name}
install -D -m 0644 -vp %{SOURCE2} %{buildroot}%{_userunitdir}/%{act_runner_rootless_service}
install -D -m 0644 -vp %{SOURCE3} %{buildroot}%{_userunitdir}/%{dockerd_rootless_service}
install -D -m 0755 -vp %{SOURCE6} %{buildroot}%{_datadir}/%{name}/rootless-act_runner-register.sh
@@ -135,6 +136,7 @@ install -D -m 0755 -vp %{SOURCE6} %{buildroot}%{_datadir}/%{name}/rootless-act_r
%files %{dockerd}
%license LICENSE
%doc README-%{dockerd}.md
%dir %{_sysconfdir}/%{name}
%{_unitdir}/*
%files %{dockerd_rootless}