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:
@ -26,6 +26,7 @@ import (
|
||||
var (
|
||||
version = "0.1"
|
||||
gitCommit string // Git SHA1 commit hash of the release (set via linker flags)
|
||||
gitDate string
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -45,6 +46,9 @@ func newApp() (app *cli.App) {
|
||||
if len(gitCommit) >= 8 {
|
||||
app.Version += "-" + gitCommit[:8]
|
||||
}
|
||||
if gitDate != "" {
|
||||
app.Version += "-" + gitDate
|
||||
}
|
||||
app.Usage = "Swarm Global Store"
|
||||
|
||||
// app flags (for all commands)
|
||||
|
@ -102,7 +102,7 @@ func init() {
|
||||
utils.ListenPortFlag.Value = 30399
|
||||
}
|
||||
|
||||
var app = utils.NewApp("", "Ethereum Swarm")
|
||||
var app = utils.NewApp("", "", "Ethereum Swarm")
|
||||
|
||||
// This init function creates the cli.App.
|
||||
func init() {
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
)
|
||||
|
||||
var gitCommit string // Git SHA1 commit hash of the release (set via linker flags)
|
||||
var gitDate string
|
||||
|
||||
// default value for "create" command --nodes flag
|
||||
const defaultNodes = 8
|
||||
@ -40,7 +41,7 @@ func main() {
|
||||
// newApp construct a new instance of Swarm Snapshot Utility.
|
||||
// Method Run is called on it in the main function and in tests.
|
||||
func newApp() (app *cli.App) {
|
||||
app = utils.NewApp(gitCommit, "Swarm Snapshot Utility")
|
||||
app = utils.NewApp(gitCommit, gitDate, "Swarm Snapshot Utility")
|
||||
|
||||
app.Name = "swarm-snapshot"
|
||||
app.Usage = ""
|
||||
|
Reference in New Issue
Block a user