Implements #46: a plain docker build . of a clone now stamps the commit's tag or short commit into the page footer instead of unknown.
.dockerignore sends .git and leaves out .git/config, which can hold a credential and which git describe does not need; the comment is the canonical one from sneak/promptsnext.
The build stage (the Debian Go image already has git) takes the VERSION build argument when one is given, otherwise git describe --tags --always, and fails if the context carries .git and the result is empty, dev or unknown. It stamps that into version.GitRevisionShort (the footer text) and the full commit into version.GitRevision (the footer link), the two variables make build sets.
make build takes GitRevisionShort from git describe --tags --always instead of git rev-parse --short, so it stamps what the image does.
script/docker is now the current canonical copy: it builds with --no-cache and passes git describe --tags --always --dirty as VERSION.
What the diff does not show:
With .git and git in the build stage, go build also records VCS details in the binary; nothing reads them.
No buildarch in the repo.
Disclosures:
Judgement call: this repo's .dockerignore (#39) shares no other text with the canonical one; only its .git/config block was taken.
REPO_POLICIES.md still shows the old ARG VERSION=dev template; it is the synced canonical copy.
script/cibuild is unchanged: it passes no version, so CI builds take it from .git.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/routewatch/issues/46: a plain `docker build .` of a clone now stamps the commit's tag or short commit into the page footer instead of `unknown`.
- `.dockerignore` sends `.git` and leaves out `.git/config`, which can hold a credential and which `git describe` does not need; the comment is the canonical one from `sneak/prompts` `next`.
- The build stage (the Debian Go image already has `git`) takes the `VERSION` build argument when one is given, otherwise `git describe --tags --always`, and fails if the context carries `.git` and the result is empty, `dev` or `unknown`. It stamps that into `version.GitRevisionShort` (the footer text) and the full commit into `version.GitRevision` (the footer link), the two variables `make build` sets.
- `make build` takes `GitRevisionShort` from `git describe --tags --always` instead of `git rev-parse --short`, so it stamps what the image does.
- `script/docker` is now the current canonical copy: it builds with `--no-cache` and passes `git describe --tags --always --dirty` as `VERSION`.
What the diff does not show:
- With `.git` and `git` in the build stage, `go build` also records VCS details in the binary; nothing reads them.
- No `buildarch` in the repo.
Disclosures:
- Judgement call: this repo's `.dockerignore` (https://git.eeqj.de/sneak/routewatch/issues/39) shares no other text with the canonical one; only its `.git/config` block was taken.
- `REPO_POLICIES.md` still shows the old `ARG VERSION=dev` template; it is the synced canonical copy.
- `script/cibuild` is unchanged: it passes no version, so CI builds take it from `.git`.
Model: opus-5-5
A plain `docker build .` stamped `unknown` into the page footer:
.dockerignore left out .git, and the Dockerfile built without the -X
flags. The context now carries .git without .git/config, which can hold
a credential. The build stage takes the VERSION build argument when one
is given, otherwise `git describe --tags --always`, fails the build if
.git is present and no version comes out, and stamps it together with
the full commit the footer links to. `make build` now uses
`git describe` as well, and script/docker is the current shared copy.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #46: a plain
docker build .of a clone now stamps the commit's tag or short commit into the page footer instead ofunknown..dockerignoresends.gitand leaves out.git/config, which can hold a credential and whichgit describedoes not need; the comment is the canonical one fromsneak/promptsnext.git) takes theVERSIONbuild argument when one is given, otherwisegit describe --tags --always, and fails if the context carries.gitand the result is empty,devorunknown. It stamps that intoversion.GitRevisionShort(the footer text) and the full commit intoversion.GitRevision(the footer link), the two variablesmake buildsets.make buildtakesGitRevisionShortfromgit describe --tags --alwaysinstead ofgit rev-parse --short, so it stamps what the image does.script/dockeris now the current canonical copy: it builds with--no-cacheand passesgit describe --tags --always --dirtyasVERSION.What the diff does not show:
.gitandgitin the build stage,go buildalso records VCS details in the binary; nothing reads them.buildarchin the repo.Disclosures:
.dockerignore(#39) shares no other text with the canonical one; only its.git/configblock was taken.REPO_POLICIES.mdstill shows the oldARG VERSION=devtemplate; it is the synced canonical copy.script/cibuildis unchanged: it passes no version, so CI builds take it from.git.Model: opus-5-5
Review passed.
Model: opus-5-5