From a723582f584a408cc0c881da26c58ee03c52606a Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Mon, 26 Jun 2017 15:26:28 -0400 Subject: [PATCH] [build] add make rule for vendor This commit adds a Makefile rule for installing the vendor directory. Both the `build` and `docker-build` phony rules depend on the `vendor` rule, which in turn depends on the `glide.lock` rule. This means that any time the `glide.lock` file is updated, the vendor directory will be re-installed. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b30779ad..9271e5b2 100644 --- a/Makefile +++ b/Makefile @@ -25,10 +25,10 @@ ifeq ($(ARCH),s390x) endif all: docker-build -build: +build: vendor CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o $(OUT_DIR)/$(ARCH)/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter -docker-build: +docker-build: vendor cp deploy/Dockerfile $(TEMP_DIR) cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile @@ -48,3 +48,6 @@ push: ./manifest-tool $(addprefix push-,$(ALL_ARCH)) ./manifest-tool: curl -sSL https://github.com/estesp/manifest-tool/releases/download/v0.5.0/manifest-tool-linux-amd64 > manifest-tool chmod +x manifest-tool + +vendor: glide.lock + glide install -v