-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (31 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
GIT_TAG := $(shell git tag --points-at HEAD)
VERSION ?= $(shell echo $${GIT_TAG:-0.0.0} | sed s/v//g)
IMAGE ?= ghcr.io/reddec/keycloak-ext-operator:$(VERSION)
LOCALBIN := $(shell pwd)/.bin
CONTROLLER_GEN := $(LOCALBIN)/controller-gen
info:
@echo $(IMAGE)
.PHONY: manifests
manifests: $(CONTROLLER_GEN) ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
.PHONY: generate
generate: $(CONTROLLER_GEN) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
.PHONY: run
run: manifests generate
direnv exec . go run ./main.go
install: manifests generate
kubectl apply -k config/crd
.PHONY: install
bundle: manifests generate
rm -rf build && mkdir build
cp -rv config ./build/
cd build/config/default && kustomize edit set image controller=${IMAGE}
kustomize build build/config/default > build/keycloak-ext-operator.yaml
rm -rf build/config
.PHONY: bundle
install:
goreleaser build --rm-dist --snapshot --single-target
$(CONTROLLER_GEN):
@mkdir -p $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/[email protected]