You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/09/22 11:22:28 UTC

[airflow-pgbouncer-exporter] 19/27: Add Makefile.

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch migrate-to-latest-pgbouncer-exported
in repository https://gitbox.apache.org/repos/asf/airflow-pgbouncer-exporter.git

commit 58bce86befc66262817dfcb85e9d4a1a9b1d806b
Author: Juraj Bubniak <ju...@gmail.com>
AuthorDate: Thu Jun 17 20:59:53 2021 +0200

    Add Makefile.
---
 Makefile | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f8930fc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+.PHONY: help build build_linux lint test race cover coverhtml
+
+help:
+	@echo "Please use 'make <target>' where <target> is one of"
+	@echo "      lint               to run golint on files recursively"
+	@echo "      build              to build binary"
+	@echo "      test               to run tests"
+	@echo "      race               to run tests with race detector"
+	@echo "      cover              to run tests with coverage"
+	@echo "      coverhtml          to run tests with coverage and generate html output"
+
+lint:
+	golangci-lint -v run
+
+build:
+	CGO_ENABLED=0 go build -ldflags "-extldflags '-static'" -tags netgo -o pgbouncer_exporter
+
+build_linux:
+	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-extldflags '-static'" -tags netgo -o pgbouncer_exporter
+
+test:
+	go test -v ./...
+
+race:
+	go test -race -v ./...
+
+cover:
+	go test -v -coverprofile=coverage.out -cover ./...
+
+coverhtml:
+	go test -v -coverprofile=coverage.out -cover ./...
+	go tool cover -html=coverage.out
\ No newline at end of file