47 lines
1.6 KiB
Desktop File
47 lines
1.6 KiB
Desktop File
# ~/.config/systemd/user/forge-watch.service (install path on apricot)
|
|
#
|
|
# Testwright watcher — polls the Forgejo commit-status API and fires a
|
|
# TTS alert via ravdess02 when `main` flips to failure.
|
|
#
|
|
# Installation (run once on apricot as lilith):
|
|
# cp .forgejo/forge-watch.service ~/.config/systemd/user/forge-watch.service
|
|
# systemctl --user daemon-reload
|
|
# systemctl --user enable --now forge-watch
|
|
# systemctl --user status forge-watch
|
|
#
|
|
# Linger must be enabled so the unit survives logout:
|
|
# loginctl enable-linger lilith (already enabled for act_runner)
|
|
#
|
|
# Environment file: create ~/.config/forge-watch/env with:
|
|
# FORGEJO_TOKEN=<token>
|
|
# FORGEJO_URL=http://forge.nasty.sh
|
|
# FORGE_REPO=magicciv/magicciv
|
|
# FORGE_BRANCH=main
|
|
# POLL_INTERVAL=30
|
|
# (Token can also be sourced from ~/.config/tokens/forgejo.sh — the
|
|
# script does this automatically if FORGEJO_TOKEN is absent.)
|
|
|
|
[Unit]
|
|
Description=Forgejo CI status watcher with TTS alert on red main
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
Restart=on-failure
|
|
RestartSec=10s
|
|
|
|
# Source the token file so FORGEJO_TOKEN is available without repeating
|
|
# it in EnvironmentFile.
|
|
ExecStart=/usr/bin/env bash -c 'source ~/.config/tokens/forgejo.sh 2>/dev/null; exec bash %h/Code/project-buildspace/magic-civilization/tools/forge-watch.sh'
|
|
|
|
# Write logs to journal (journalctl --user -u forge-watch -f)
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=forge-watch
|
|
|
|
# State directory lives at $XDG_STATE_HOME/forge-watch/ (auto-created
|
|
# by the script; no StateDirectory= directive needed for --user units).
|
|
|
|
[Install]
|
|
WantedBy=default.target
|