Stamp the tag or short commit in a plain docker build (closes #211)
check / check (pull_request) Successful in 3m54s
check / check (pull_request) Successful in 3m54s
A plain `docker build .` stamped `dev`: `.dockerignore` left out `.git` and the Dockerfile defaulted VERSION to `dev`. `.dockerignore` is now the canonical one plus this repo's entries, sending `.git` without `.git/config`. Given no build arguments, the builder stamps `git describe --tags --always` and the commit and date from git, and fails if `.git` is present but yields no version. The empty CHECK_EPOCH refusal is gone so the plain build succeeds; the scripts still pass an epoch. `script/version` now prints `git describe --tags --always --dirty`, so make, the scripts and a plain build agree. Model: opus-5-5
This commit is contained in:
@@ -34,9 +34,9 @@ func TestGlobalsNew(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestIsDevVersion covers the boundary that matters: everything
|
||||
// script/version and goreleaser's snapshot template can emit for an
|
||||
// untagged build must be recognised as a development build, and a real
|
||||
// tag must not be. A plain equality check against "dev" used to decide
|
||||
// goreleaser's snapshot template, and script/version outside a git
|
||||
// checkout, can emit must be recognised as a development build, and a
|
||||
// real tag must not be. A plain equality check against "dev" used to decide
|
||||
// this, which classified every commit-stamped dev build as a release.
|
||||
func TestIsDevVersion(t *testing.T) {
|
||||
t.Parallel()
|
||||
@@ -49,8 +49,8 @@ func TestIsDevVersion(t *testing.T) {
|
||||
{"dev", true},
|
||||
{"dev-b6e4a218a39e", true},
|
||||
{"dev-b6e4a218a39e-dirty", true},
|
||||
// What a tagged build produces (script/version strips the
|
||||
// leading "v", matching goreleaser's .Version).
|
||||
// What a tagged build produces (goreleaser's .Version strips
|
||||
// the leading "v"; script/version keeps it).
|
||||
{"1.0.0", false},
|
||||
{"0.1.0", false},
|
||||
{"1.0.0-rc.1", false},
|
||||
|
||||
Reference in New Issue
Block a user