9 Commits

Author SHA1 Message Date
0ebd1b0229 ci: change repo owner
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 21s
2026-04-19 12:46:05 +02:00
a6fb133216 fix: remove path for binaries in unit files
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-12 17:59:01 +02:00
fc6ce6f472 fix: stop services on postun scriptlet
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-12 17:01:55 +02:00
146da6bcea fix: typo in file name
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
2026-04-12 16:40:52 +02:00
e2d80629f3 fix: add actrunner config with runner location 2026-04-12 13:08:01 +02:00
3499d1461c fix: change directory for act_runner register 2026-04-12 12:47:06 +02:00
b6d6e871b0 fix: use local gitea instance 2026-04-12 12:26:44 +02:00
26ae0ff6fd fix: set unit with type notify 2026-04-12 11:19:57 +02:00
0b71cf4c42 fix: add env vars in unit file 2026-04-12 10:12:16 +02:00
6 changed files with 36 additions and 14 deletions

View File

@@ -9,12 +9,10 @@ jobs:
lint_n_build:
runs-on: self-hosted
steps:
- name: Git checkout
uses: actions/checkout@v6
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Build tarball
run: make tarball
- name: Build rpm file
run: rpmbuild -ba "$(make name).spec"
- run: shellcheck files/sbin/gitea_web_notify
- run: make tarball
- run: rpmbuild -ba "$(make name).spec"

View File

@@ -2,7 +2,7 @@ NAME = netoik-git
VERSION = $(shell git describe --abbrev=0)
RELEASE = $(shell git rev-parse --short HEAD)
ARCH = noarch
OWNER = samuel
OWNER = netoik
SUMMARY = "Netoïk Git server"
LICENSE = "MIT"
URL = "https://git.netoik.io/$(OWNER)/$(NAME)"
@@ -74,11 +74,12 @@ install: ## Install files into rpm dest (requires env var DESTDIR)
printf "[CRITICAL] Missing env var DESTDIR\n[CRITICAL] This command is designed to be called by rpmbuild only!\n" 1>&2; \
exit 1; \
fi
install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d $(DESTDIR)$(RPM_SYSCONFDIR)/gitea $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)$(RPM_TMPPATH)/gitea_images
install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d $(DESTDIR)$(RPM_SYSCONFDIR)/gitea $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)$(RPM_TMPPATH)/gitea_images $(DESTDIR)$(RPM_SBINDIR)
install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d files/nginx/git.netoik.io.conf
install --mode=640 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/gitea files/gitea/app.ini
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR) files/systemd/gitea.service files/systemd/actrunner@.service
install --mode=644 --target-directory=$(DESTDIR)$(RPM_TMPPATH)/gitea_images files/img/*
install --mode=644 --target-directory=$(DESTDIR)$(RPM_TMPPATH)/gitea_images files/img/{favicon,logo}.{svg,png}
install --mode=755 --target-directory=$(DESTDIR)$(RPM_SBINDIR) files/sbin/gitea_web_notify
.PHONY: upload
upload: ## Upload rpm package to Gitea repository (requires env var PKG_TOKEN)

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Display commands, exit on error and enable job control
set -xem
gitea web &
until curl --fail --head http://localhost:3000
do
sleep 1
done
systemd-notify --ready
fg %1

View File

@@ -4,8 +4,8 @@ Documentation=https://gitea.com/gitea/act_runner
After=gitea.service
[Service]
ExecStart=/usr/sbin/act_runner daemon
ExecReload=/bin/kill -s HUP $MAINPID
ExecStart=act_runner daemon
ExecReload=kill -s HUP $MAINPID
WorkingDirectory=/var/lib/actrunner%i
TimeoutSec=0
RestartSec=10

View File

@@ -4,12 +4,14 @@ After=network.target postgresql.service valkey.service
[Service]
RestartSec=2s
Type=simple
Type=notify
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/sbin/gitea web
Environment=GITEA_WORK_DIR=/var/lib/gitea
ExecStart=gitea_web_notify
Restart=always
NotifyAccess=all
[Install]
WantedBy=multi-user.target

View File

@@ -101,7 +101,8 @@ for i in $(seq 1 4); do
useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system actrunner$i
fi
runuser --user=actrunner$i -- rpmdev-setuptree
runuser --user=actrunner$i -- act_runner register --instance https://git.netoik.io --labels self-hosted --name actrunner$i --no-interactive --token $ACTRUNNER_TOKEN
printf "runner:\n file: %{_sharedstatedir}/actrunner$i/.runner\n" > %{_sharedstatedir}/actrunner$i/config.yaml
runuser --user=actrunner$i -- act_runner --config %{_sharedstatedir}/actrunner$i/config.yaml register --instance http://127.0.0.1:3000 --labels self-hosted --name actrunner$i --no-interactive --token $ACTRUNNER_TOKEN
systemctl reenable actrunner@$i.service
systemctl restart actrunner@$i.service
done
@@ -110,6 +111,12 @@ done
# Display commands and exit on error
set -xe
# Stop services
systemctl stop gitea.service
for i in $(seq 1 4); do
systemctl stop actrunner@$i
done
# If uninstalling, then delete users and db
if [ $1 == 0 ]; then
# Remove gitea user if existing
@@ -148,5 +155,7 @@ fi
%dir %attr(755, root, root) %{_tmppath}/gitea_images
%attr(644, root, root) %{_tmppath}/gitea_images/{favicon,logo}.{png,svg}
%attr(755, root, root) %{_sbindir}/gitea_web_notify
%changelog
%autochangelog