Switch to dep for dependency management

I find it to be a bit faster in some cases, and easier to work with.
This commit is contained in:
Solly Ross 2018-06-22 11:44:01 -04:00
parent 2984604be8
commit ad1837e9b5
6 changed files with 901 additions and 608 deletions

View file

@ -31,14 +31,14 @@ endif
all: 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
CGO_ENABLED=0 GOARCH=$(ARCH) go build -tags netgo -o $(OUT_DIR)/$(ARCH)/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter
docker-build: vendor
cp deploy/Dockerfile $(TEMP_DIR)
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
docker run -it -v $(TEMP_DIR):/build -v $(shell pwd):/go/src/github.com/directxman12/k8s-prometheus-adapter -e GOARCH=$(ARCH) $(GOIMAGE) /bin/bash -c "\
CGO_ENABLED=0 go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter"
CGO_ENABLED=0 go build -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter"
docker build -t $(REGISTRY)/$(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR)
rm -rf $(TEMP_DIR)
@ -54,13 +54,13 @@ push: ./manifest-tool $(addprefix push-,$(ALL_ARCH))
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
vendor: Gopkg.lock
ifeq ($(VENDOR_DOCKERIZED),1)
docker run -it -v $(shell pwd):/go/src/github.com/directxman12/k8s-prometheus-adapter -w /go/src/github.com/directxman12/k8s-prometheus-adapter golang:1.8 /bin/bash -c "\
curl https://glide.sh/get | sh \
&& glide install -v"
docker run -it -v $(shell pwd):/go/src/github.com/directxman12/k8s-prometheus-adapter -w /go/src/github.com/directxman12/k8s-prometheus-adapter golang:1.10 /bin/bash -c "\
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
&& dep ensure -vendor-only"
else
glide install -v
dep ensure -vendor-only
endif
test: vendor