Commit c8bc377b47
Verified · cmc ci/build: success ci/test: success ci/vuln: success
Layout: unified · split
Makefile +5 −1
| @@ -74,9 +74,13 @@ deploy-runner: preflight | |||
| 74 | ./deploy/copy.sh $(HOST) $(PORT) $(RUNNER_BIN) /usr/local/bin/gitbay-runner.new | 74 | ./deploy/copy.sh $(HOST) $(PORT) $(RUNNER_BIN) /usr/local/bin/gitbay-runner.new |
| 75 | ssh -p $(PORT) root@$(HOST) 'mkdir -p /etc/systemd/system/gitbay-runner.service.d' | 75 | ssh -p $(PORT) root@$(HOST) 'mkdir -p /etc/systemd/system/gitbay-runner.service.d' |
| 76 | ./deploy/copy.sh $(HOST) $(PORT) deploy/gitbay-runner.override.conf /etc/systemd/system/gitbay-runner.service.d/override.conf | 76 | ./deploy/copy.sh $(HOST) $(PORT) deploy/gitbay-runner.override.conf /etc/systemd/system/gitbay-runner.service.d/override.conf |
| 77 | ./deploy/copy.sh $(HOST) $(PORT) deploy/gitbay-runner-prune.service /etc/systemd/system/gitbay-runner-prune.service | ||
| 78 | ./deploy/copy.sh $(HOST) $(PORT) deploy/gitbay-runner-prune.timer /etc/systemd/system/gitbay-runner-prune.timer | ||
| 77 | ssh -p $(PORT) root@$(HOST) 'set -eu; \ | 79 | ssh -p $(PORT) root@$(HOST) 'set -eu; \ |
| 78 | chmod 755 /usr/local/bin/gitbay-runner.new; \ | 80 | chmod 755 /usr/local/bin/gitbay-runner.new; \ |
| 79 | mv /usr/local/bin/gitbay-runner.new /usr/local/bin/gitbay-runner; \ | 81 | mv /usr/local/bin/gitbay-runner.new /usr/local/bin/gitbay-runner; \ |
| 80 | systemctl daemon-reload; \ | 82 | systemctl daemon-reload; \ |
| 83 | systemctl enable --now gitbay-runner-prune.timer; \ | ||
| 81 | systemctl restart gitbay-runner; \ | 84 | systemctl restart gitbay-runner; \ |
| 82 | systemctl --no-pager --lines=3 status gitbay-runner' | 85 | systemctl --no-pager --lines=3 status gitbay-runner; \ |
| 86 | systemctl --no-pager list-timers gitbay-runner-prune.timer' | ||
deploy/gitbay-runner-prune.service +3
| @@ -7,6 +7,9 @@ Description=Prune unused podman images on the CI runner | |||
| 7 | [Service] | 7 | [Service] |
| 8 | Type=oneshot | 8 | Type=oneshot |
| 9 | User=ci-runner | 9 | User=ci-runner |
| 10 | # Rootless podman reads storage.conf under HOME; a User= unit does not | ||
| 11 | # set it. | ||
| 12 | Environment=HOME=/var/lib/gitbay-runner | ||
| 10 | # Images not used by a container and older than a week. A build that | 13 | # Images not used by a container and older than a week. A build that |
| 11 | # names an image again re-pulls it; the cost is one pull, not a failure. | 14 | # names an image again re-pulls it; the cost is one pull, not a failure. |
| 12 | ExecStart=/usr/bin/podman image prune --all --force --filter until=168h | 15 | ExecStart=/usr/bin/podman image prune --all --force --filter until=168h |