mirror of
https://github.com/hikhvar/mqtt2prometheus.git
synced 2026-02-14 09:59:52 +00:00
Initial commit
This commit is contained in:
42
Makefile
Normal file
42
Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
ifndef GOARCH
|
||||
GOARCH:=$(shell go env GOARCH)
|
||||
endif
|
||||
|
||||
ifndef GOOS
|
||||
GOOS:=$(shell go env GOOS)
|
||||
endif
|
||||
|
||||
ifndef TARGET_FILE
|
||||
TARGET_FILE:=bin/mqtt2prometheus.$(GOOS)_$(GOARCH)
|
||||
endif
|
||||
|
||||
install-dep:
|
||||
@which dep || go get -u github.com/golang/dep/cmd/dep
|
||||
|
||||
Gopkg.lock: | install-dep
|
||||
dep ensure --no-vendor
|
||||
|
||||
Gopkg.toml: | install-dep
|
||||
dep init
|
||||
|
||||
prepare-vendor: Gopkg.toml Gopkg.lock
|
||||
dep ensure -update --no-vendor
|
||||
dep status
|
||||
@echo "You can apply these locks via 'make apply-vendor-lock' or rollback via 'git checkout -- Gopkg.lock'"
|
||||
|
||||
vendor: Gopkg.toml Gopkg.lock
|
||||
dep ensure -vendor-only
|
||||
dep status
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
build: vendor
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(TARGET_FILE) ./cmd
|
||||
|
||||
static_build: vendor
|
||||
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(TARGET_FILE) -a -tags netgo -ldflags '-w -extldflags "-static"' ./cmd
|
||||
|
||||
container:
|
||||
docker build -t mqtt2prometheus:latest .
|
||||
Reference in New Issue
Block a user