check / check (push) Failing after 3s
Each Dockerfile stage that runs gates now checks, right after its ARG CHECK_EPOCH, that the value is not empty, and stops with a message naming script/cibuild and script/docker. A plain `docker build .` can no longer report a green from cached gate layers. script/cibuild and script/docker now append the process id to the epoch, the form script/lint already uses, so two runs started in the same second still get different values. README says both. TODO.md corrects the steady-state CACHED count recorded for issue 32 from twelve to thirteen. Model: opus-5-5
26 lines
866 B
Bash
Executable File
26 lines
866 B
Bash
Executable File
#!/bin/sh
|
|
# script/docker: build the Docker image tagged with the project name.
|
|
# The tag comes from script/projectname.
|
|
#
|
|
# CHECK_EPOCH is passed for the same reason script/cibuild passes it:
|
|
# without a fresh value Docker serves the gate layers from cache on an
|
|
# unchanged tree and this exits 0 having run none of the lint stage's
|
|
# gates, the markdown stage's prettier gate or the builder stage's test
|
|
# gate. This is the set of gates a developer or reviewer runs by hand,
|
|
# so a cached pass here is the most misleading result the repo can
|
|
# produce. Dependency layers sit above the ARG and stay cached.
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
|
|
main() {
|
|
cd "$ROOT"
|
|
docker build \
|
|
--build-arg CHECK_EPOCH="$(date +%s)-$$" \
|
|
-t "$("$SCRIPT_DIR/projectname")" \
|
|
.
|
|
}
|
|
|
|
main "$@"
|