Skip to content

Commit 9ab919e

Browse files
fix: check OS and arch in make install-ocb to get correct version (#150)
### Description Check OS and arch in make install-ocb to get correct version. This now adds linux support. ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
1 parent 239f2e5 commit 9ab919e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Uncomment to use OTEL Collector Builder installed by `install-ocb`
2-
OCB=$(HOME)/bin/ocb
2+
OCB = $(HOME)/bin/ocb
3+
UNAME_S := $(shell uname -s)
4+
ifeq ($(UNAME_S),Linux)
5+
OS = linux
6+
endif
7+
ifeq ($(UNAME_S),Darwin)
8+
OS = darwin
9+
endif
10+
OCB_VERSION = 0.114.0
11+
ARCH := $(shell arch)
12+
ifeq ($(ARCH),x86_64)
13+
ARCH = amd64
14+
endif
315

416
# Uncomment to use OTEL Collector Builder installed by
517
# `go install go.opentelemetry.io/collector/cmd/[email protected]`
@@ -29,8 +41,8 @@ release:
2941
## install-ocb: Installs correct version of ocb binary
3042
install-ocb:
3143
@mkdir -p "$(HOME)/bin"
32-
curl --proto '=https' --tlsv1.2 -L -o "$(HOME)/bin/ocb" https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fbuilder%2Fv0.110.0/ocb_0.110.0_darwin_arm64
33-
@chmod +x "$(HOME)/bin/ocb"
44+
curl --proto "=https" --tlsv1.2 -L -o "$(OCB)" "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fbuilder%2Fv$(OCB_VERSION)/ocb_$(OCB_VERSION)_$(OS)_$(ARCH)"
45+
@chmod +x "$(OCB)"
3446

3547
## build-ocb: Builds project using ocb
3648
build-ocb:

0 commit comments

Comments
 (0)