Drops the manual refresh dance. A new `runner-refresh` compose service polls Forgejo every RUNNER_REFRESH_INTERVAL seconds (default 300), fetches yarn.lock + package.json from each repo in RUNNER_CACHE_SEED_REPOS, hashes them, and rebuilds forgejo-stack/job:latest whenever the hash changes. `docker create` on the rebuilt tag is automatic — forgejo-runner uses forcePull=false so subsequent job containers pick up the refreshed image without a runner restart. - scripts/refresh-runner-image.sh: idempotent; hash-compares against cache-seed/.last-fetched.sha256 to skip rebuilds when nothing changed. Uses `sed` (not `grep -oP`) so it works under busybox inside docker:cli's alpine base. - docker-compose.yml: adds the `runner-refresh` service (docker:cli + docker.sock + project bind-mount + bash/curl install). Idles via `sleep infinity` when RUNNER_CACHE_SEED_REPOS is unset, so the service is safe to leave running on stacks that don't pre-warm. - setup.sh: one-time prime after Forgejo is healthy so fresh installs bake the cache before the runner takes its first job. Subsequent refreshes are driven by the service. - .env.example: documents RUNNER_CACHE_SEED_REPOS and RUNNER_REFRESH_INTERVAL. Verified end-to-end: pushed a yarn.lock mutation → refresh tick detected diff → rebuilt image in ~25s → second tick reported "lockfiles unchanged; image current". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bootstrap-forgejo.sh | ||
| bootstrap-repo.sh | ||
| lib.sh | ||
| migrate-from-github.sh | ||
| refresh-runner-image.sh | ||
| smoke-test.sh | ||