cmd, internal/build, docker: advertise commit date in unstable build versions (#19522)
* add-date-to unstable * fields-insteadof-split * internal/build: support building with missing git * docker: add git history back to support commit date in version * internal/build: use PR commits hashes for PR builds
This commit is contained in:
@ -92,16 +92,13 @@ GLOBAL OPTIONS:
|
||||
}
|
||||
|
||||
// NewApp creates an app with sane defaults.
|
||||
func NewApp(gitCommit, usage string) *cli.App {
|
||||
func NewApp(gitCommit, gitDate, usage string) *cli.App {
|
||||
app := cli.NewApp()
|
||||
app.Name = filepath.Base(os.Args[0])
|
||||
app.Author = ""
|
||||
//app.Authors = nil
|
||||
app.Email = ""
|
||||
app.Version = params.VersionWithMeta
|
||||
if len(gitCommit) >= 8 {
|
||||
app.Version += "-" + gitCommit[:8]
|
||||
}
|
||||
app.Version = params.VersionWithCommit(gitCommit, gitDate)
|
||||
app.Usage = usage
|
||||
return app
|
||||
}
|
||||
|
Reference in New Issue
Block a user