Run the checks on every script/cibuild and script/docker build (closes #101)
check / check (push) Successful in 12m54s
check / check (push) Successful in 12m54s
Both scripts pass a new CHECK_EPOCH, which the Dockerfile's make fmt-check, make lint and make test steps name in their commands. On an unchanged tree Docker used to serve those steps from its build cache, so a run could pass without checking anything. The script/bootstrap steps stay cached. A plain docker build . still works, as upaas builds the image that way: it leaves CHECK_EPOCH empty and reuses the check steps only for an identical build context. Model: opus-5-5
This commit is contained in:
+7
-3
@@ -1,7 +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.
|
||||
# Generic: needs no adaptation.
|
||||
# Identical in all repos; the tag comes from script/projectname. Like
|
||||
# script/cibuild, it passes a new CHECK_EPOCH, so the build runs the
|
||||
# checks instead of reusing cached results. Generic: needs no
|
||||
# adaptation.
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
@@ -9,7 +11,9 @@ ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
docker build -t "$("$SCRIPT_DIR/projectname")" .
|
||||
epoch="$(date +%s)$$"
|
||||
docker build --build-arg CHECK_EPOCH="$epoch" \
|
||||
-t "$("$SCRIPT_DIR/projectname")" .
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user