Commit 61d2e39
Eric Bower
·
2026-07-22 09:51:16 -0400 EDT
parent 0842022
refactor: use `pici` as the pipe event topic name feat: add systemd unit files
5 files changed,
+37,
-5
+1,
-1
| ... | ... | @@ -74,6 +74,6 @@ while read -r old_sha new_sha ref; do | |
| 74 | 74 | fi | |
| 75 | 75 | ||
| 76 | 76 | log "publish: $event" | |
| 77 | - | echo "$event" | ssh -T "$PIPE_HOST" pub -b=false build.event | |
| 77 | + | echo "$event" | ssh -T "$PIPE_HOST" pub -b=false pici | |
| 78 | 78 | log "done" | |
| 79 | 79 | done |
+17,
-0
| ... | ... | @@ -0,0 +1,17 @@ | |
| 1 | + | [Unit] | |
| 2 | + | Description=pici monitor - watch job status and send email notifications | |
| 3 | + | After=network-online.target | |
| 4 | + | Wants=network-online.target | |
| 5 | + | ||
| 6 | + | [Service] | |
| 7 | + | Type=simple | |
| 8 | + | WorkingDirectory=/home/erock/dev/pici | |
| 9 | + | Environment=PATH=/home/erock/.local/bin:/home/erock/go/bin:/usr/local/bin:/usr/bin:/bin | |
| 10 | + | Environment=PGS_USERNAME=erock | |
| 11 | + | Environment=RECIPIENT=monitor@erock.io | |
| 12 | + | ExecStart=/usr/bin/bash -c 'pici monitor | /home/erock/dev/pici/scripts/monitor-email.sh' | |
| 13 | + | Restart=always | |
| 14 | + | RestartSec=10 | |
| 15 | + | ||
| 16 | + | [Install] | |
| 17 | + | WantedBy=default.target |
+15,
-0
| ... | ... | @@ -0,0 +1,15 @@ | |
| 1 | + | [Unit] | |
| 2 | + | Description=pici build runner - subscribe to build events and execute them | |
| 3 | + | After=network-online.target | |
| 4 | + | Wants=network-online.target | |
| 5 | + | ||
| 6 | + | [Service] | |
| 7 | + | Type=simple | |
| 8 | + | WorkingDirectory=/home/erock/dev/pici | |
| 9 | + | Environment=PATH=/home/erock/.local/bin:/home/erock/go/bin:/usr/local/bin:/usr/bin:/bin | |
| 10 | + | ExecStart=/usr/bin/bash /home/erock/dev/pici/run.sh | |
| 11 | + | Restart=always | |
| 12 | + | RestartSec=5 | |
| 13 | + | ||
| 14 | + | [Install] | |
| 15 | + | WantedBy=default.target |
M
run.sh
+2,
-2
| ... | ... | @@ -5,8 +5,8 @@ | |
| 5 | 5 | # Usage: ./run.sh | |
| 6 | 6 | ||
| 7 | 7 | while true; do | |
| 8 | - | echo "waiting for build.event ..." | |
| 9 | - | event=$(ssh pipe sub build.event 2>/dev/null) | |
| 8 | + | echo "waiting for pici event ..." | |
| 9 | + | event=$(ssh pipe sub pici 2>/dev/null) | |
| 10 | 10 | if [ -n "$event" ]; then | |
| 11 | 11 | echo "$event" | pici runner --wait | |
| 12 | 12 | else |
+2,
-2
| ... | ... | @@ -809,8 +809,8 @@ details .faq-answer { | |
| 809 | 809 | <span style="margin-left: 0.5rem;">ci.pico.sh</span> | |
| 810 | 810 | </div> | |
| 811 | 811 | <div class="terminal-body"> | |
| 812 | - | <div><span class="prompt">$ </span><span class="cmd">echo '{"type":"push"}' | ssh pipe.pico.sh pub build.event</span></div> | |
| 813 | - | <div><span class="output">subscribe to this channel: ssh pipe.pico.sh sub build.event</span></div> | |
| 812 | + | <div><span class="prompt">$ </span><span class="cmd">echo '{"type":"push"}' | ssh pipe.pico.sh pub pici</span></div> | |
| 813 | + | <div><span class="output">subscribe to this channel: ssh pipe.pico.sh sub pici</span></div> | |
| 814 | 814 | <div> </div> | |
| 815 | 815 | <div><span class="info">🚀 starting job ci.myrepo.a3f2b8c1</span></div> | |
| 816 | 816 | <div><span class="info">📦 syncing workspace</span></div> |