Derive the image version from git; send .git to the build (closes #69)
check / check (push) Successful in 28s

The canonical documents told every repo to exclude .git from the build
context, default ARG VERSION to dev and never run git describe in a
build stage, so an image built from a clone with no build argument
reported dev. .dockerignore now sends .git. The Dockerfile example in
REPO_POLICIES.md installs git, takes the VERSION build argument when one
is given and otherwise git describe --tags --always, and fails when .git
is present but the version is empty, dev or unknown. The checklists, the
Go docs' Makefile comments, the README, and this repo's Dockerfile and
scripts now say the same.

Model: opus-5-5
This commit is contained in:
2026-10-02 00:49:56 +00:00
parent 2ae9391b26
commit c460b0d6a5
10 changed files with 73 additions and 56 deletions
+2 -3
View File
@@ -13,9 +13,8 @@
# `/myapp`, never `**/myapp`, which also matches `cmd/myapp/` and
# deletes the package directory from the context.
# Excluding .git means `git describe` cannot run in any build stage and
# fails quietly there; pass the version in with --build-arg VERSION.
.git
# .git is sent: without a VERSION build argument, the stage that compiles
# takes the version from `git describe --tags --always` on it.
# Agent scratch: one full checkout of the repo per in-flight agent.
# Anchored because it occurs once where agents run at the repo root.