Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a98911563 |
@@ -1,8 +1,9 @@
|
|||||||
.PHONY: all bootstrap setup check test lint fmt fmt-check build clean deps test-coverage test-integration install release release-snapshot docker hooks
|
.PHONY: all bootstrap setup check test lint fmt fmt-check build clean deps test-coverage test-integration install release release-snapshot docker hooks
|
||||||
|
|
||||||
# Stamped into the binary: the same `git describe` a plain `docker build .`
|
# Stamped into the binary: the same `git describe` the Dockerfile runs, so a
|
||||||
# runs, or dev when it prints nothing (outside a git checkout, or where git is
|
# host build reports the same version as the image, or dev when it prints
|
||||||
# missing). ?= so that a VERSION already in the environment takes precedence.
|
# nothing (outside a git checkout, or where git is missing). ?= so that a
|
||||||
|
# VERSION already in the environment takes precedence.
|
||||||
VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev)
|
VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev)
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
|
|||||||
@@ -204,18 +204,14 @@ With no flags, the tool extracts the day before the latest snapshot. All
|
|||||||
progress is logged as structured `slog` text to stderr; the first line of every
|
progress is logged as structured `slog` text to stderr; the first line of every
|
||||||
run carries the version.
|
run carries the version.
|
||||||
|
|
||||||
The version is set at link time and depends on how the binary was built:
|
The version is the git tag or short commit the binary was built from, set at
|
||||||
|
link time. `docker build .` takes it from the `VERSION` build argument when one
|
||||||
- `docker build .` takes it from the `VERSION` build argument when one is given,
|
is given, otherwise from `git describe --tags --always` on the `.git` in the
|
||||||
otherwise from `git describe --tags --always` on the `.git` in the build
|
build context, and fails if `.git` is there and the version still comes out
|
||||||
context. The build fails if `.git` is there and the version still comes out
|
empty, `dev` or `unknown`. `script/docker` and `script/cibuild` pass
|
||||||
empty, `dev` or `unknown`. With neither `.git` nor `VERSION`, the binary
|
`git describe --tags --always --dirty` from the host as that argument. `make`
|
||||||
reports `dev`.
|
runs the same `git describe` on the host. A build with no version to go on
|
||||||
- `script/docker`, `script/cibuild` and `make docker` pass the host's
|
reports `dev`.
|
||||||
`git describe --tags --always --dirty` as `VERSION`, so on a modified tree the
|
|
||||||
version ends in `-dirty`. When that prints nothing, they pass `unknown`.
|
|
||||||
- `make` stamps the host's `git describe --tags --always`, without `-dirty`, or
|
|
||||||
`dev` when that prints nothing.
|
|
||||||
|
|
||||||
## Merging dumps back into a database
|
## Merging dumps back into a database
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user