Skip to content

Commit

Permalink
Use yq to edit the version in builder config. Also remove the version…
Browse files Browse the repository at this point in the history
… (v) prefix
  • Loading branch information
rnishtala-sumo committed Dec 18, 2024
1 parent faf6369 commit 024a859
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ update-ot: install-gsed
@test $(OT_CORE_NEW) || (echo "usage: make update-ot OT_CORE_NEW=x.x.x OT_CONTRIB_NEW=y.y.y"; exit 1);
@test $(OT_CONTRIB_NEW) || (echo "usage: make update-ot OT_CORE_NEW=x.x.x OT_CONTRIB_NEW=y.y.y"; exit 1);
@echo "Updating OT core from $(OT_CORE_VERSION) to $(OT_CORE_NEW) and OT contrib from $(OT_CONTRIB_VERSION) to $(OT_CONTRIB_NEW)"
$(SED) -i "s/\(version:\) $(OT_CORE_VERSION)$$/\1 $(OT_CORE_NEW)/" otelcolbuilder/.otelcol-builder.yaml
$(shell yq e ".dist.version = \"${OT_CORE_NEW}\"" -i otelcolbuilder/.otelcol-builder.yaml)
$(SED) -i "s/\(go\.opentelemetry\.io\/collector\/.*\) v$(OT_CORE_VERSION)$$/\1 v$(OT_CORE_NEW)/" otelcolbuilder/.otelcol-builder.yaml
$(SED) -i "s/\(github\.com\/open-telemetry\/opentelemetry-collector-contrib\/.*\) v$(OT_CONTRIB_VERSION)$$/\1 v$(OT_CONTRIB_NEW)/" otelcolbuilder/.otelcol-builder.yaml
$(SED) -i "s/$(OT_CORE_VERSION)/$(OT_CORE_NEW)/" otelcolbuilder/Makefile
Expand Down
2 changes: 1 addition & 1 deletion otelcolbuilder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ endif

.PHONY: _builder
_builder:
$(eval VERSION ?= $(shell git describe --tags --abbrev=5 --match "v[0-9]*"))
$(eval VERSION ?= $(shell git describe --tags --abbrev=5 --match "v[0-9]*"| sed 's/^v//'))
$(shell yq e ".dist.version = \"${VERSION}${FIPS_SUFFIX}\"" -i .otelcol-builder.yaml)
$(eval SUMOVERSION ?= $(shell yq '.dist.version' .otelcol-builder.yaml))
@echo "Building otelcol-sumo version: $(SUMOVERSION)"
Expand Down

0 comments on commit 024a859

Please sign in to comment.