9b61d24773
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
39 lines
1.0 KiB
Makefile
39 lines
1.0 KiB
Makefile
OS ?= $(shell go env GOOS)
|
|
ARCH ?= $(shell go env GOARCH)
|
|
|
|
IMAGE_NAME := "webhook"
|
|
IMAGE_TAG := "latest"
|
|
|
|
OUT := $(shell pwd)/_out
|
|
|
|
KUBEBUILDER_VERSION=2.3.2
|
|
|
|
$(shell mkdir -p "$(OUT)")
|
|
|
|
test: _test/kubebuilder
|
|
go test -v .
|
|
|
|
_test/kubebuilder:
|
|
curl -fsSL https://github.com/kubernetes-sigs/kubebuilder/releases/download/v$(KUBEBUILDER_VERSION)/kubebuilder_$(KUBEBUILDER_VERSION)_$(OS)_$(ARCH).tar.gz -o kubebuilder-tools.tar.gz
|
|
mkdir -p _test/kubebuilder
|
|
tar -xvf kubebuilder-tools.tar.gz
|
|
mv kubebuilder_$(KUBEBUILDER_VERSION)_$(OS)_$(ARCH)/bin _test/kubebuilder/
|
|
rm kubebuilder-tools.tar.gz
|
|
rm -R kubebuilder_$(KUBEBUILDER_VERSION)_$(OS)_$(ARCH)
|
|
|
|
clean: clean-kubebuilder
|
|
|
|
clean-kubebuilder:
|
|
rm -Rf _test/kubebuilder
|
|
|
|
build:
|
|
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
|
|
|
|
.PHONY: rendered-manifest.yaml
|
|
rendered-manifest.yaml:
|
|
helm template \
|
|
--name example-webhook \
|
|
--set image.repository=$(IMAGE_NAME) \
|
|
--set image.tag=$(IMAGE_TAG) \
|
|
deploy/example-webhook > "$(OUT)/rendered-manifest.yaml"
|