Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ builds:
- binary: mongodb_exporter
id: mongodb_exporter
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build clean default help init test format check-license
.PHONY: all build clean default help init test format check-license release-dry-run
default: help

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

release-dry-run: ## Build cross-platform binaries locally without publishing
@echo "Building cross-platform binaries with GoReleaser..."
@if command -v goreleaser >/dev/null 2>&1; then \
goreleaser build --snapshot --clean; \
else \
echo "GoReleaser not found. Installing via Docker..."; \
docker run --rm --privileged \
-v ${PWD}:/go/src/github.com/percona/mongodb_exporter \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/percona/mongodb_exporter \
goreleaser/goreleaser build --snapshot --clean; \
fi
@find build -name mongodb_exporter -type f | sort


FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")

format: ## Format source code
Expand Down
Loading