Derive the image's version from the .git in the build context (closes #366)
check / check (push) Successful in 4m59s
check / check (push) Successful in 4m59s
A plain docker build, as upaas runs it, passed no VERSION build arg and had no .git, so every such image stamped "unknown". .dockerignore now sends .git and every tracked file (an excluded one would read as deleted and mark the version -dirty), and the VERSION build arg loses its "unknown" default, so script/version derives the version inside the build. A VERSION build arg still takes precedence. The builder stage installs git and fails when its context carries .git and the version still comes out "unknown". Model: opus-5-5
This commit is contained in:
@@ -28,12 +28,11 @@ jobs:
|
||||
run: script/ci-mark-superseded
|
||||
|
||||
- name: Fingerprint the build context
|
||||
# `.dockerignore` keeps docs out of the build context, so a docs-only
|
||||
# commit legitimately replays the whole image from cache and stays
|
||||
# cheap. Every other commit writes a new fingerprint into the context,
|
||||
# which invalidates the `COPY . .` layer of both check stages: a
|
||||
# commit that was never linted, formatted-checked, tested and built
|
||||
# cannot report success from cache.
|
||||
# Every commit that changes more than docs writes a new fingerprint
|
||||
# into the context, which invalidates the `COPY . .` layer of both
|
||||
# check stages: a commit that was never linted, formatted-checked,
|
||||
# tested and built cannot report success from cache. Docs-only
|
||||
# commits rebuild too, since the context also carries `.git`.
|
||||
run: |
|
||||
set -eu
|
||||
fp="$(git log -1 --format=%H -- . ':!*.md' ':!LICENSE' ':!.editorconfig')"
|
||||
|
||||
Reference in New Issue
Block a user