Skip to content
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
5 changes: 2 additions & 3 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
verbose: true
go:
version: 1.16
version: 1.20.4
cgo: false
repository:
path: github.com/pgpool/pgpool2_exporter
Expand All @@ -17,4 +16,4 @@ build:
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- LICENSE
- LICENSE
22 changes: 17 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO := go
GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))

PROMU ?= $(GOPATH)/bin/promu
PROMU ?= $(GOPATH)/bin/promu -v
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)

PREFIX ?= $(shell pwd)
Expand All @@ -12,15 +12,19 @@ DOCKER_IMAGE_NAME ?= pgpool2_exporter
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))


build: promu
build: clean promu
@echo ">> building binaries"
@$(PROMU) build --prefix $(PREFIX)

crossbuild: promu
@echo ">> building cross-platform binaries"
@$(PROMU) crossbuild

promu:
get-promu:
@echo ">> downloading promu"
go get github.com/prometheus/promu

promu: get-promu
@GOOS=$(shell uname -s | tr A-Z a-z) \
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
$(GO) install github.com/prometheus/promu
Expand All @@ -33,8 +37,16 @@ tarballs: crossbuild
@echo ">> building release tarballs"
@$(PROMU) crossbuild tarballs

docker:
docker: build
@echo ">> building docker image"
@docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .

.PHONY: promu build crossbuild tarball tarballs docker
push: docker
@echo ">> pushing docker image to registry"
@docker image push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)"

clean:
@echo ">> cleaning up build output"
rm -f $(PREFIX)/pgpool2_exporter

.PHONY: promu clean build crossbuild tarball tarballs docker
2 changes: 1 addition & 1 deletion cmd/pgpool2_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/promlog/flag"
"github.com/prometheus/common/version"
"gopkg.in/alecthomas/kingpin.v2"
"github.com/alecthomas/kingpin/v2"

exp "github.com/pgpool/pgpool2_exporter"
)
Expand Down
40 changes: 19 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
module github.com/pgpool/pgpool2_exporter

go 1.17
go 1.20

require (
github.com/alecthomas/kingpin/v2 v2.3.2
github.com/blang/semver v3.5.1+incompatible
github.com/go-kit/log v0.2.0
github.com/golang/protobuf v1.5.2 // indirect
github.com/go-kit/log v0.2.1
github.com/golang/protobuf v1.5.3 // indirect
github.com/lib/pq v1.10.2
github.com/prometheus/client_golang v1.12.0
github.com/prometheus/common v0.32.1
github.com/prometheus/procfs v0.7.3 // indirect
github.com/stretchr/testify v1.7.0 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/common v0.44.0
github.com/prometheus/procfs v0.9.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
golang.org/x/sys v0.9.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)

require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-github/v25 v25.1.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/promu v0.13.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/promu v0.15.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/oauth2 v0.9.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading