From 03ee288c3a230ac0dd18f51bbdc9eba8a7132184 Mon Sep 17 00:00:00 2001 From: Jim Tilander Date: Tue, 14 Feb 2017 22:41:26 -0800 Subject: [PATCH] Added a cross compilation target as well as push --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7781485a..a41a1f7e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ CONTAINER_NAME ?= wrouesnel/postgres_exporter:latest all: vet test postgres_exporter +# Cross compilation (e.g. if you are on a Mac) +cross: docker-build docker + # Simple go build postgres_exporter: $(GO_SRC) CGO_ENABLED=0 go build -a -ldflags "-extldflags '-static' -X main.Version=$(shell git describe --dirty)" -o postgres_exporter . @@ -37,4 +40,7 @@ docker-build: postgres_exporter /bin/bash -c "make >&2 && chown $$SHELL_UID:$$SHELL_GID ./postgres_exporter" docker build -t $(CONTAINER_NAME) . -.PHONY: docker-build docker test vet +push: + docker push $(CONTAINER_NAME) + +.PHONY: docker-build docker test vet push cross