Skip to content
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

chore(Makefile): 🔧 update build targets #139

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
./config/default-config.yaml

# build folder
.build
build

*.rollback
signoz-collector
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ test:

.PHONY: build
build:
CGO_ENABLED=1 go build -tags timetzdata -o .build/${GOOS}-${GOARCH}/signoz-collector -ldflags "-linkmode external -extldflags '-static' -s -w ${LD_FLAGS}" ./cmd/signozcollector
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o signoz-collector ./cmd/signozcollector

.PHONY: build-static
CGO_ENABLED=1 go build -tags timetzdata -o build/${GOOS}-${GOARCH}/signoz-collector -ldflags "-linkmode external -extldflags '-static' -s -w ${LD_FLAGS}" ./cmd/signozcollector

.PHONY: amd64
amd64:
make GOARCH=amd64 build
make GOARCH=amd64 build-static

.PHONY: arm64
arm64:
make CC=aarch64-linux-gnu-gcc GOARCH=arm64 build
make CC=aarch64-linux-gnu-gcc GOARCH=arm64 build-static

.PHONY: build-all
build-all: amd64 arm64
Expand Down
2 changes: 1 addition & 1 deletion cmd/signozcollector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG USER_UID=10001
USER ${USER_UID}

# copy the binaries from the multi-stage build
COPY .build/${TARGETOS}-${TARGETARCH}/signoz-collector /signoz-collector
COPY build/${TARGETOS}-${TARGETARCH}/signoz-collector /signoz-collector

# copy the config and migration files
COPY config/default-config.yaml /etc/otel/config.yaml
Expand Down