-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change build info date to commit timestamp #3876
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ IMPORT_LOG=.import.log | |
|
||
GIT_SHA=$(shell git rev-parse HEAD) | ||
GIT_CLOSEST_TAG=$(shell git describe --abbrev=0 --tags) | ||
DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
DATE=$(shell date -u -d @$(shell git show -s --format=%ct) +'%Y-%m-%dT%H:%M:%SZ') | ||
BUILD_INFO_IMPORT_PATH=$(JAEGER_IMPORT_PATH)/pkg/version | ||
BUILD_INFO=-ldflags "-X $(BUILD_INFO_IMPORT_PATH).commitSHA=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).latestVersion=$(GIT_CLOSEST_TAG) -X $(BUILD_INFO_IMPORT_PATH).date=$(DATE)" | ||
|
||
|
@@ -170,15 +170,15 @@ build-tracegen: | |
|
||
.PHONY: build-anonymizer | ||
build-anonymizer: | ||
$(GOBUILD) -o ./cmd/anonymizer/anonymizer-$(GOOS)-$(GOARCH) ./cmd/anonymizer/main.go | ||
$(GOBUILD) -o ./cmd/anonymizer/anonymizer-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/anonymizer/main.go | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe it's better to define GOBUILD to contain BUILD_INFO, to avoid this repetition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've limited the scope to those that include `github.com/jaegertracing/jaeger/pkg/version. Including it in GOBUILD does seem like a reasonable improvement for consistency across the binaries but would force changes to the actual go code for some number of binaries. |
||
|
||
.PHONY: build-esmapping-generator | ||
build-esmapping-generator: | ||
$(GOBUILD) -o ./plugin/storage/es/esmapping-generator-$(GOOS)-$(GOARCH) ./cmd/esmapping-generator/main.go | ||
$(GOBUILD) -o ./plugin/storage/es/esmapping-generator-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/esmapping-generator/main.go | ||
|
||
.PHONY: build-esmapping-generator-linux | ||
build-esmapping-generator-linux: | ||
GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./plugin/storage/es/esmapping-generator ./cmd/esmapping-generator/main.go | ||
GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./plugin/storage/es/esmapping-generator $(BUILD_INFO) ./cmd/esmapping-generator/main.go | ||
|
||
.PHONY: build-es-index-cleaner | ||
build-es-index-cleaner: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
date -d
does not work on Mac. We can do this directly with git:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 0f87027