Files
quak/script/docker
T
clawbot a92e4929f8
check / check (push) Successful in 5m22s
Make lint and test phases of the Dockerfile (closes #96)
Follows the template: Dockerfile.lint is gone; the Dockerfile has a lint
phase (eslint, prettier --check .) and a test phase (vitest), and its last
stage compiles and depends on both. script/lint and script/test build one
phase each with --no-cache; script/docker and script/cibuild pass
--no-cache, so CHECK_EPOCH and LINT_EPOCH are removed. script/cibuild is
the single image build, so CI runs lint and the tests once each. The tests
that checked the old layout are deleted, REPO_POLICIES.md is re-copied and
the README describes the new layout.

Model: opus-5-5
2026-09-23 03:38:46 +00:00

26 lines
949 B
Bash
Executable File

#!/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 because the gate phases the final stage depends on are RUN
# steps, and a cached one is a check that did not run.
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
main() {
cd "$ROOT"
# Own line: a failing command substitution inside an argument does
# not trip `set -e`, so the inline form degrades silently to an
# empty constant. VERSION is computed here because .dockerignore
# excludes .git, so `git describe` in a build stage yields an empty
# version without failing.
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
[ -n "$version" ] || version="unknown"
docker build --no-cache \
--build-arg VERSION="$version" \
-t "$("$SCRIPT_DIR/projectname")" .
}
main "$@"