[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.
This commit is contained in:
Solly Ross 2017-06-26 15:26:28 -04:00
parent 3618aafca4
commit a723582f58

View file

@ -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