Gate the build on Docker lint and test phases (closes #40, closes #30)
Some checks failed
check / check (push) Failing after 15s

Per the owner ruling on issue 40, linting and testing are phases of the
main Dockerfile rather than a separate lint file. script/lint and
script/test each build one phase by name with caching disabled, and the
final stage copies a harmless file from each so the image cannot be built
unless both passed — the ordering trick already in template-app-go's
Dockerfile, extended to the test phase. A phase that is not the last
stage is built only when something depends on it or --target names it, so
the gates are always invoked by name and the edges are kept. Every build
in script/ is tagged. No config verify step; fmt stays on the host. This
closes issue 30 too: a container has its own result cache and lock.

Model: opus-5
This commit is contained in:
2026-09-08 04:58:31 +00:00
parent 51df10e1f7
commit 7f4ef15610
12 changed files with 305 additions and 133 deletions

View File

@@ -1,8 +1,9 @@
#!/bin/sh
# script/docker: build the Docker image tagged with the project name.
# Identical in all repos; the tag comes from script/projectname.
# --no-cache for the same reason as script/cibuild: a cached check layer
# is a check that did not run.
# --no-cache because this is a standalone entrypoint: the lint and test
# phases the final stage depends on must run rather than be served from
# an older build.
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"