deploy: rebuild build: images when their inputs change #290
No reviewers
Labels
No labels
audit-work
bug
docs
general-admin
major-upgrade
needs-vps-sync
new-service
on-hold
outside-work
post-podman
renovate
upstream
vps
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mysticalsoap/docker!290
Loading…
Reference in a new issue
No description provided.
Delete branch "deploy-rebuild"
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
just deploykeyed on*/compose.ymlonly. A Renovate bump of a DockerfileFROMdigest, or an edit to anything a Dockerfile copies, changed nothing live until a manual build. Four images are built locally (config-renderer behind five init containers, dagu-tools, metadata, knock). Closes #288.Fix
changed_stacksnow also matches a stack when a changed path is one of its build inputs: eachbuild:service's Dockerfile plus the sources of itsCOPY/ADDlines (globs cut at the first wildcard,--from=stages skipped). Contexts and dockerfile overrides are read fromdocker compose config --format json, so they resolve exactly as compose does. The whole build context is deliberately not watched: config-renderer and knock build from_helperitself, and that would recreate infra on every docs edit.build:stack is brought up with--build. Cache hit when nothing changed, real build otherwise.--dry-runprints what would be recreated. Maintenance.md updated in both places that describejust deploy.Verification
_helper/config-renderer/Dockerfile; dagu →dagu/tools/Dockerfile; media →media/metadata/Dockerfile; web →_helper/knock/Dockerfileplus_helper/common,_helper/knock/requirements.txt,jellyfin-defaults.json,static,templates.{_helper/knock/requirements.txt, _helper/common/notify.py, _helper/docs/Maintenance.md, dagu/tools/Dockerfile}selects exactly dagu and web; the docs path triggers nothing.python3 _helper/deploy.py --dry-runon a clean tree: "No changed stacks to deploy." Withdagu --dry-run: "would recreate dagu/compose.yml (with --build)".just deploy dagufor real: dagu-dagu-tools built (cache), container recreated, stack healthy.