mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-06 20:38:22 +00:00
PT-2165 actual version, go version, and build for go tools (#603)
* PT-2165 - Actual Version, GoVersion, and Build for Go tools Removed outdated numbers from main.go, because we update these numbers in the Makefile. * PT-2165 - Actual Version, GoVersion, and Build for Go tools Added template version into Makefile for the latest tag.
This commit is contained in:
@@ -18,6 +18,8 @@ endif
|
|||||||
|
|
||||||
GO := go
|
GO := go
|
||||||
pkgs = $(shell find . -type d -name "pt-*" -exec basename {} \;)
|
pkgs = $(shell find . -type d -name "pt-*" -exec basename {} \;)
|
||||||
|
# VERSION ?=$(shell git describe --abbrev=0) doesn't always work here, need to use git log
|
||||||
|
VERSION ?=$(shell git log --no-walk --tags --pretty="%H %d" --decorate=short | head -n1 | awk -F'[, ]' '{ print $$4; }')
|
||||||
BUILD=$(BUILD_DATE)
|
BUILD=$(BUILD_DATE)
|
||||||
GOVERSION=$(shell go version | cut --delimiter=" " -f3)
|
GOVERSION=$(shell go version | cut --delimiter=" " -f3)
|
||||||
GOUTILSDIR ?= $(GOPATH)/bin
|
GOUTILSDIR ?= $(GOPATH)/bin
|
||||||
|
@@ -15,10 +15,10 @@ const (
|
|||||||
|
|
||||||
// We do not set anything here, these variables are defined by the Makefile
|
// We do not set anything here, these variables are defined by the Makefile
|
||||||
var (
|
var (
|
||||||
Build string
|
Build string //nolint
|
||||||
GoVersion string
|
GoVersion string //nolint
|
||||||
Version string
|
Version string //nolint
|
||||||
Commit string
|
Commit string //nolint
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@@ -45,11 +45,12 @@ const (
|
|||||||
TOOLNAME = "pt-mongodb-index-check"
|
TOOLNAME = "pt-mongodb-index-check"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// We do not set anything here, these variables are defined by the Makefile
|
||||||
var (
|
var (
|
||||||
Build string = "2020-04-23" //nolint
|
Build string //nolint
|
||||||
GoVersion string = "1.14.1" //nolint
|
GoVersion string //nolint
|
||||||
Version string = "3.5.1" //nolint
|
Version string //nolint
|
||||||
Commit string //nolint
|
Commit string //nolint
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@@ -38,11 +38,12 @@ const (
|
|||||||
DEFAULT_SKIPCOLLECTIONS = "system.profile" // comma separated list
|
DEFAULT_SKIPCOLLECTIONS = "system.profile" // comma separated list
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// We do not set anything here, these variables are defined by the Makefile
|
||||||
var (
|
var (
|
||||||
Build string = "2020-04-23" //nolint
|
Build string //nolint
|
||||||
GoVersion string = "1.14.1" //nolint
|
GoVersion string //nolint
|
||||||
Version string = "3.5.1" //nolint
|
Version string //nolint
|
||||||
Commit string //nolint
|
Commit string //nolint
|
||||||
)
|
)
|
||||||
|
|
||||||
type cliOptions struct {
|
type cliOptions struct {
|
||||||
|
@@ -55,10 +55,11 @@ const (
|
|||||||
|
|
||||||
//nolint:gochecknoglobals
|
//nolint:gochecknoglobals
|
||||||
var (
|
var (
|
||||||
Build string = "2020-04-23"
|
// We do not set anything here, these variables are defined by the Makefile
|
||||||
GoVersion string = "1.14.1"
|
Build string //nolint
|
||||||
Version string = "3.5.1"
|
GoVersion string //nolint
|
||||||
Commit string
|
Version string //nolint
|
||||||
|
Commit string //nolint
|
||||||
|
|
||||||
defaultConnectionTimeout = 3 * time.Second
|
defaultConnectionTimeout = 3 * time.Second
|
||||||
directConnection = true
|
directConnection = true
|
||||||
|
@@ -17,11 +17,12 @@ import (
|
|||||||
"github.com/percona/percona-toolkit/src/go/pt-pg-summary/templates"
|
"github.com/percona/percona-toolkit/src/go/pt-pg-summary/templates"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// We do not set anything here, these variables are defined by the Makefile
|
||||||
var (
|
var (
|
||||||
Build string = "2020-04-23" //nolint
|
Build string //nolint
|
||||||
Commit string //nolint
|
GoVersion string //nolint
|
||||||
GoVersion string = "1.14.1" //nolint
|
Version string //nolint
|
||||||
Version string = "3.5.1" //nolint
|
Commit string //nolint
|
||||||
)
|
)
|
||||||
|
|
||||||
type connOpts struct {
|
type connOpts struct {
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
GO := go
|
GO := go
|
||||||
pkgs = $(shell basename `git rev-parse --show-toplevel`)
|
pkgs = $(shell basename `git rev-parse --show-toplevel`)
|
||||||
VERSION ?=$(shell git describe --abbrev=0)
|
# VERSION ?=$(shell git describe --abbrev=0) doesn't always work here, need to use git log
|
||||||
|
VERSION ?=$(shell git log --no-walk --tags --pretty="%H %d" --decorate=short | head -n1 | awk -F'[, ]' '{ print $$4; }')
|
||||||
BUILD ?=$(shell date +%FT%T%z)
|
BUILD ?=$(shell date +%FT%T%z)
|
||||||
GOVERSION ?=$(shell go version | cut --delimiter=" " -f3)
|
GOVERSION ?=$(shell go version | cut --delimiter=" " -f3)
|
||||||
COMMIT ?=$(shell git rev-parse HEAD)
|
COMMIT ?=$(shell git rev-parse HEAD)
|
||||||
|
@@ -84,10 +84,11 @@ var (
|
|||||||
"pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass",
|
"pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass",
|
||||||
}
|
}
|
||||||
|
|
||||||
Build string = "2020-04-23" //nolint
|
// We do not set anything here, these variables are defined by the Makefile
|
||||||
GoVersion string = "1.14.1" //nolint
|
Build string //nolint
|
||||||
Version string = "3.5.1" //nolint
|
GoVersion string //nolint
|
||||||
Commit string //nolint
|
Version string //nolint
|
||||||
|
Commit string //nolint
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Reference in New Issue
Block a user