mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
Merge pull request #10 from DirectXMan12/refactor/glide-makefile-tweaks
Makefile Tweaks
This commit is contained in:
commit
78d9749971
2 changed files with 14 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
vendor
|
vendor
|
||||||
./adapter
|
_output
|
||||||
|
|
|
||||||
17
Makefile
17
Makefile
|
|
@ -4,6 +4,7 @@ TEMP_DIR:=$(shell mktemp -d)
|
||||||
ARCH?=amd64
|
ARCH?=amd64
|
||||||
ALL_ARCH=amd64 arm arm64 ppc64le s390x
|
ALL_ARCH=amd64 arm arm64 ppc64le s390x
|
||||||
ML_PLATFORMS=linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x
|
ML_PLATFORMS=linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x
|
||||||
|
OUT_DIR?=./_output
|
||||||
|
|
||||||
VERSION?=latest
|
VERSION?=latest
|
||||||
|
|
||||||
|
|
@ -23,11 +24,13 @@ ifeq ($(ARCH),s390x)
|
||||||
BASEIMAGE?=s390x/busybox
|
BASEIMAGE?=s390x/busybox
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: docker-build
|
.PHONY: all build docker-build push-% push test
|
||||||
build:
|
|
||||||
CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter
|
|
||||||
|
|
||||||
docker-build:
|
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
|
||||||
|
|
||||||
|
docker-build: vendor
|
||||||
cp deploy/Dockerfile $(TEMP_DIR)
|
cp deploy/Dockerfile $(TEMP_DIR)
|
||||||
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
|
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
|
||||||
|
|
||||||
|
|
@ -47,3 +50,9 @@ push: ./manifest-tool $(addprefix push-,$(ALL_ARCH))
|
||||||
./manifest-tool:
|
./manifest-tool:
|
||||||
curl -sSL https://github.com/estesp/manifest-tool/releases/download/v0.5.0/manifest-tool-linux-amd64 > 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
|
chmod +x manifest-tool
|
||||||
|
|
||||||
|
vendor: glide.lock
|
||||||
|
glide install -v
|
||||||
|
|
||||||
|
test: vendor
|
||||||
|
CGO_ENABLED=0 go test ./pkg/...
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue