Skip to content

Commit

Permalink
Get the correct version from the binary
Browse files Browse the repository at this point in the history
  • Loading branch information
rnishtala-sumo committed Dec 3, 2024
1 parent c167b4d commit 0a98a1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/get_version_from_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ parse_version() {

output="$(${binary_path} --version)"

regex=".* ([0-9]+)\.([0-9]+)\.([0-9]+)\-sumo\-([0-9]+).*"
regex="otelcol-sumo version ([0-9]+)\.([0-9]+)\.([0-9]+)\-sumo\-([0-9]+).*"

if [[ $output =~ $regex ]]; then
major_version="${BASH_REMATCH[1]}"
Expand Down
3 changes: 2 additions & 1 deletion otelcolbuilder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ endif

.PHONY: _builder
_builder:
$(eval VERSION ?= devel-$(shell git rev-parse HEAD | xargs))
$(eval VERSION ?= $(shell git describe --tags --abbrev=5 --match "v[0-9]*"))
$(shell sed -i '' "s/^ version:.*/ version: ${VERSION}${FIPS_SUFFIX}/" .otelcol-builder.yaml)
# Need to specify go path because otherwise opentelemetry-collector-builder
# uses /usr/bin/go which on Github Actions is using preinstalled 1.15.12 by default.
CGO_ENABLED=$(CGO_ENABLED) $(BUILDER_BIN_NAME) \
Expand Down

0 comments on commit 0a98a1e

Please sign in to comment.