docker build . stamps the git tag or short commit, not dev (closes #154)
check / check (push) Failing after 46s
check / check (push) Failing after 46s
A plain `docker build .` now stamps the version from git rather than `dev`/`0.0.0`. After `tsc`, `script/build` writes into `dist/package.json` the version `script/version` decides: `VERSION` when given, otherwise `git describe --tags --always` (the tag; or tag, commits since and short commit; or the short commit), otherwise `package.json`'s. A checkout with `.git` that yields an empty, `dev` or `unknown` version fails the build. `.dockerignore` sends `.git` but not `.git/config`, so no remote URL or credential reaches the image. `ARG VERSION` has no default, and the host scripts' version still wins. Not changed: `REPO_POLICIES.md` still says `ARG VERSION=dev` until the shared policy changes. Model: opus-5-5 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #157.
This commit is contained in:
+6
-3
@@ -61,9 +61,12 @@ RUN script/bootstrap
|
||||
|
||||
COPY . .
|
||||
|
||||
# The version is computed on the host and passed in, because
|
||||
# .dockerignore excludes .git.
|
||||
ARG VERSION=dev
|
||||
# Version stamped into the build: the VERSION build arg when one is given,
|
||||
# otherwise what script/version derives from the .git the build context
|
||||
# carries (script/bootstrap installed git), so any `docker build .` of a
|
||||
# clone stamps its commit. The label can only carry the build arg, and is
|
||||
# empty without one.
|
||||
ARG VERSION
|
||||
LABEL org.opencontainers.image.version="${VERSION}"
|
||||
|
||||
RUN make build
|
||||
|
||||
Reference in New Issue
Block a user