preview sync.sh: overlapping runs leave a directory that stops every later run #15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Running
docs/preview/sync.shby hand while the timer's run was in progress broke every later run:The second run's cleanup (
rm -f data/.incoming/*) deleted the archive the first run was about to unpack; the first run then started the unpack container with-v .../pr-14.zip:/in.zip, and Docker creates a missing bind-mount source as a directory. From then on the cleanup fails on that directory andset -estops every run, so no preview updates (PR #14's never appeared).Plan
flock -nondata/.lock): a second run while one is going exits quietly.data/.incomingread-only at/inin the unpack container and pass the archive's name inZIP, instead of bind-mounting the file, so nothing can create a directory in its place.rm -rf data/.incomingand recreate it, so anything odd left there is gone on the next run../sync.shby hand next to the timer is safe.Also in #16: the previews shared one Traefik router (
Host(a) || Host(b)), so each certificate named every preview and a pull request opening or closing re-issued all of them. They now get one router, and one certificate, each.Also in #16: previews never followed pushes to an open pull request (the runs query filtered on
event=pull_request, which Forgejo does not match for runs after a push), so each kept its first build.