deploy/gitbay-runner-prune.service

ff759b53942049b2043e132f5482b442a7265b98
gitbay/deploy/gitbay-runner-prune.service history · blame · raw

16 lines · 651 bytes

 1# Paired with gitbay-runner-prune.timer. Runs as the runner's own user,
 2# because rootless podman's store belongs to that user and root's prune
 3# would not see it.
 4[Unit]
 5Description=Prune unused podman images on the CI runner
 6
 7[Service]
 8Type=oneshot
 9User=ci-runner
10# Rootless podman reads storage.conf under HOME; a User= unit does not
11# set it.
12Environment=HOME=/var/lib/gitbay-runner
13# Images not used by a container and older than a week. A build that
14# names an image again re-pulls it; the cost is one pull, not a failure.
15ExecStart=/usr/bin/podman image prune --all --force --filter until=168h
16ExecStart=/usr/bin/podman container prune --force