#!/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 it Docker serves the Dockerfile's 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 "$@"