-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (29 loc) · 1008 Bytes
/
Makefile
File metadata and controls
43 lines (29 loc) · 1008 Bytes
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
42
43
CONTROLLER_GEN ?= $(shell which controller-gen 2>/dev/null || echo "go run sigs.k8s.io/controller-tools/cmd/controller-gen")
BINARY = bin/agent-access-controller
IMG ?= quay.io/azaalouk/agent-access-control:latest
.PHONY: all build generate manifests run test install clean docker-build docker-push deploy undeploy
all: generate manifests build
build:
go build -o $(BINARY) ./cmd/main.go
generate:
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
manifests:
$(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=config/crd/bases
run: generate manifests
go run ./cmd/main.go
test:
go test ./... -v -coverprofile cover.out
install: manifests
kubectl apply -f config/crd/bases/
uninstall:
kubectl delete -f config/crd/bases/ --ignore-not-found
docker-build:
docker build -t $(IMG) .
docker-push:
docker push $(IMG)
deploy: install
kubectl apply -f deploy/
undeploy:
kubectl delete -f deploy/ --ignore-not-found
clean:
rm -rf bin/ cover.out