-
Notifications
You must be signed in to change notification settings - Fork 190
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
Autobump Collector VERSION to latest on build - #1401
Conversation
Replace the mechanism to fetch VERSION from remote versions.yaml with OTELCOL_VERSION placeholder. Add a new target set-otelcol-version to set the OpenTelemetry Collector version from go.mod. Modify the build target to depend on set-otelcol-version. Remove the update-collector-version target and its usage in the build target.
modified: .gitignore deleted: collector/VERSION
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.
Thanks for doing this.
GIT_SHA=$(shell git rev-parse HEAD) | ||
GOARCH ?= amd64 | ||
GOBUILD=GO111MODULE=on CGO_ENABLED=0 installsuffix=cgo go build -trimpath | ||
BUILD_INFO_IMPORT_PATH=main | ||
|
||
LDFLAGS=-ldflags "-s -w -X $(BUILD_INFO_IMPORT_PATH).GitHash=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION) \ | ||
LDFLAGS=-ldflags "-s -w -X $(BUILD_INFO_IMPORT_PATH).GitHash=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).Version=$(OTELCOL_VERSION) \ |
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.
TIL variables in Makefiles are dynamically expanded.
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.
The purpose of the PR is to automate the Lambda Layer Collector build and release process by extracting version information from dependency files for the
LDFLAGS
ingo build
and store the information in theVERSION
file where it can be used by processes (such as crafting release notes) where consistent version information is needed.