Skip to content

Commit

Permalink
fix: check OS and arch in make install-ocb to get correct version (#150)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
obs-gh-mattcotter authored Dec 19, 2024
1 parent 239f2e5 commit 9ab919e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Uncomment to use OTEL Collector Builder installed by `install-ocb`
OCB=$(HOME)/bin/ocb
OCB = $(HOME)/bin/ocb
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS = linux
endif
ifeq ($(UNAME_S),Darwin)
OS = darwin
endif
OCB_VERSION = 0.114.0
ARCH := $(shell arch)
ifeq ($(ARCH),x86_64)
ARCH = amd64
endif

# Uncomment to use OTEL Collector Builder installed by
# `go install go.opentelemetry.io/collector/cmd/[email protected]`
Expand Down Expand Up @@ -29,8 +41,8 @@ release:
## install-ocb: Installs correct version of ocb binary
install-ocb:
@mkdir -p "$(HOME)/bin"
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
@chmod +x "$(HOME)/bin/ocb"
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)"
@chmod +x "$(OCB)"

## build-ocb: Builds project using ocb
build-ocb:
Expand Down

0 comments on commit 9ab919e

Please sign in to comment.