add automatic version string based on git-describe (tags)
This commit is contained in:
parent
46edad2748
commit
2fe2d9ac62
4
Makefile
4
Makefile
|
@ -120,10 +120,10 @@ dep:
|
|||
|
||||
# Build binary
|
||||
build:
|
||||
GO111MODULE=on go build
|
||||
GO111MODULE=on go build -ldflags="-X github.com/zcash/lightwalletd/common.Version=`git describe --tags`"
|
||||
|
||||
build_rel:
|
||||
GO111MODULE=on GOOS=linux go build
|
||||
GO111MODULE=on GOOS=linux go build -ldflags="-X github.com/zcash/lightwalletd/common.Version=`git describe --tags`"
|
||||
|
||||
# Install binaries into Go path
|
||||
install:
|
||||
|
|
|
@ -182,7 +182,7 @@ func startServer(opts *common.Options) error {
|
|||
os.Exit(1)
|
||||
}()
|
||||
|
||||
common.Log.Infof("Starting gRPC server on %s", opts.BindAddr)
|
||||
common.Log.Infof("Starting gRPC server version %s on %s", common.Version, opts.BindAddr)
|
||||
|
||||
err = server.Serve(listener)
|
||||
if err != nil {
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/zcash/lightwalletd/common"
|
||||
)
|
||||
|
||||
// versionCmd represents the version command
|
||||
|
@ -12,6 +13,6 @@ var versionCmd = &cobra.Command{
|
|||
Short: "Dispaly lightwalletd version",
|
||||
Long: `Dispaly lightwalletd version.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("lightwalletd version v0.2.0")
|
||||
fmt.Println("lightwalletd version", common.Version)
|
||||
},
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -16,6 +16,9 @@ import (
|
|||
"github.com/zcash/lightwalletd/walletrpc"
|
||||
)
|
||||
|
||||
// 'make build' will overwrite this string with the output of git-describe (tag)
|
||||
var Version = "v0.0.0.0-dev"
|
||||
|
||||
type Options struct {
|
||||
BindAddr string `json:"bind_address,omitempty"`
|
||||
TLSCertPath string `json:"tls_cert_path,omitempty"`
|
||||
|
|
Loading…
Reference in New Issue