Skip to content

Commit f6c7e38

Browse files
committed
roll back dynamic linking
1 parent 28a507e commit f6c7e38

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ builds:
44
- binary: mongodb_exporter
55
id: mongodb_exporter
66
env:
7+
- CGO_ENABLED=0
78
goos:
89
- linux
910
- darwin

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all build clean default help init test format check-license
1+
.PHONY: all build clean default help init test format check-license release-dry-run release-dry-run-docker release-dry-run-fast
22
default: help
33

44
GO_TEST_PATH ?= ./...
@@ -83,6 +83,21 @@ release: ## Build the binaries using goreleaser
8383
-w /go/src/github.com/user/repo \
8484
goreleaser/goreleaser release --snapshot --skip=publish --clean
8585

86+
release-dry-run: ## Build cross-platform binaries locally without publishing
87+
@echo "Building cross-platform binaries with GoReleaser..."
88+
@if command -v goreleaser >/dev/null 2>&1; then \
89+
goreleaser build --snapshot --clean; \
90+
else \
91+
echo "GoReleaser not found. Installing via Docker..."; \
92+
docker run --rm --privileged \
93+
-v ${PWD}:/go/src/github.com/percona/mongodb_exporter \
94+
-v /var/run/docker.sock:/var/run/docker.sock \
95+
-w /go/src/github.com/percona/mongodb_exporter \
96+
goreleaser/goreleaser build --snapshot --clean; \
97+
fi
98+
@find build -name mongodb_exporter -type f | sort
99+
100+
86101
FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
87102

88103
format: ## Format source code

0 commit comments

Comments
 (0)