Report the version: docker build . stamps the git tag or short commit (closes #7)
check / check (push) Successful in 59s
check / check (push) Successful in 59s
attrsum --version now prints the git tag or short commit. make build stamps it with -X from git describe, and the Dockerfile takes the VERSION build argument when given, otherwise git describe --tags --always on the .git in the build context, failing if .git is present and no version comes out. A new .dockerignore, the canonical one, keeps .git/config out of the context, and also this repo's host-built /attrsum. CI checks out full history so it sees the 1.0.0 tag and stamps what a full clone does. script/docker is replaced with the canonical copy. Model: opus-5-5
This commit was merged in pull request #8.
This commit is contained in:
+7
-2
@@ -36,6 +36,10 @@ const (
|
||||
progressThrottle = 250 * time.Millisecond
|
||||
)
|
||||
|
||||
// Version is the git tag or short commit, set at link time with -X by
|
||||
// `make build`. A build that does not set it reports dev.
|
||||
var Version = "dev" //nolint:gochecknoglobals // set at link time with -X
|
||||
|
||||
// Sentinel errors returned by the command implementations.
|
||||
var (
|
||||
errNoPaths = errors.New("no paths provided")
|
||||
@@ -101,8 +105,9 @@ func main() {
|
||||
opts := &options{}
|
||||
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "attrsum",
|
||||
Short: "Compute and verify file checksums via xattrs",
|
||||
Use: "attrsum",
|
||||
Short: "Compute and verify file checksums via xattrs",
|
||||
Version: Version,
|
||||
}
|
||||
rootCmd.SilenceUsage = true
|
||||
rootCmd.SilenceErrors = true
|
||||
|
||||
Reference in New Issue
Block a user