Skip to content

Commit 38fc921

Browse files
Mixficsolwuxianrong
andauthored
fix: Fixed version information for Pika, Pika_exporter, Codis (OpenAtomFoundation#3054)
* Fixed version information for Pika, Pika_exporter, Codis * Delete redundant logic --------- Co-authored-by: wuxianrong <[email protected]>
1 parent 618424c commit 38fc921

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ aux_source_directory(src DIR_SRCS)
737737

738738
# # generate version
739739
string(TIMESTAMP TS "%Y-%m-%d %H:%M:%S" UTC)
740-
set(PIKA_BUILD_DATE "${TS}" CACHE STRING "the time we first built pika")
740+
set(PIKA_BUILD_DATE "${TS}")
741741

742742
find_package(Git)
743743

codis/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
export GO111MODULE=on
44

5-
build-all: codis-dashboard codis-proxy codis-admin codis-ha codis-fe
5+
build-all: codis-dashboard codis-proxy codis-admin codis-ha codis-fe generate-version
66

77
PRJ_ROOT=${CURDIR}
88

99

1010
codis-deps:
1111
@mkdir -p ./bin && go version
12-
1312
codis-dashboard: codis-deps
1413
$(info build codis-dashboard)
1514
@cd ${PRJ_ROOT}/cmd/dashboard && go mod tidy && go build -buildvcs=false -o ${PRJ_ROOT}/bin/codis-dashboard .
@@ -33,6 +32,10 @@ codis-fe: codis-deps
3332
@cd ${PRJ_ROOT}/cmd/fe && go mod tidy && go build -buildvcs=false -o ${PRJ_ROOT}/bin/codis-fe .
3433
@rm -rf ${PRJ_ROOT}/bin/assets && cp -rf ${PRJ_ROOT}/cmd/fe/assets ./bin/
3534

35+
generate-version:
36+
$(info generate version)
37+
@./version
38+
3639
clean:
3740
$(info ...Clean Start!)
3841
@rm -rf bin

tools/pika_exporter/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
# export PATH := $(PATH):$(GOPATH)/bin
66

7-
# for mac
8-
BRANCH := $(shell git branch | sed 's/* \(.*\)/\1/p')
9-
# for Linux
10-
# BRANCH := $(shell git branch | sed --quiet 's/* \(.*\)/\1/p')
11-
GITREV := $(shell git rev-parse --short HEAD)
7+
GITREV := $(shell git rev-parse HEAD)
128
BUILDTIME := $(shell date '+%F %T %Z')
139
COMPILERVERSION := $(subst go version ,,$(shell go version))
1410
PROJNAME := pika_exporter

tools/pika_exporter/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ func getEnvInt(key string, defaultVal int) int {
5555
func main() {
5656
flag.Parse()
5757

58-
log.Println("Pika Metrics Exporter ", BuildVersion, "build date:", BuildDate, "sha:", BuildCommitSha, "go version:", GoVersion)
58+
log.Println("Pika Metrics Exporter")
59+
log.Println("Build Date: ", BuildDate)
60+
log.Println("Commit SHA: ", BuildCommitSha)
61+
log.Println("Go Version: ", GoVersion)
5962
if *showVersion {
6063
return
6164
}

0 commit comments

Comments
 (0)