forked from sse-secure-systems/connaisseur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.84 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
42
43
44
45
46
47
48
NAMESPACE = connaisseur
IMAGE_REPO := $(shell yq e '.kubernetes.deployment.image.repository' charts/connaisseur/values.yaml)
VERSION := $(shell yq e '.appVersion' charts/connaisseur/Chart.yaml)
KD := kubernetes.deployment
ALL_RS := all,mutatingwebhookconfigurations,clusterroles,clusterrolebindings,configmaps,secrets,serviceaccounts,crds
.PHONY: docker install install-dev uninstall annihilate test upgrade kind-dev lint integration alerting
# meant for local building of docker image
docker:
docker buildx build --pull -f build/Dockerfile -t $(IMAGE_REPO):v$(VERSION) .
install:
helm install connaisseur charts/connaisseur --atomic --create-namespace --namespace $(NAMESPACE) $(HELM_ARGS)
install-dev:
helm install --set $(KD).replicasCount=1,$(KD).pullPolicy=Never,application.logLevel=debug \
connaisseur charts/connaisseur --atomic --create-namespace --namespace $(NAMESPACE) $(HELM_ARGS)
uninstall:
helm uninstall connaisseur -n $(NAMESPACE)
kubectl delete ns $(NAMESPACE)
annihilate:
kubectl delete $(ALL_RS) -lapp.kubernetes.io/instance=connaisseur -n $(NAMESPACE)
kubectl delete imagepolicies -lapp.kubernetes.io/instance=connaisseur -n $(NAMESPACE) || true
kubectl delete ns $(NAMESPACE)
test:
go test ./internal/... -race -coverprofile=cover.out -covermode=atomic; go tool cover -func cover.out
upgrade:
helm upgrade connaisseur charts/connaisseur --namespace $(NAMESPACE) --wait
kind-dev:
make docker && kind load docker-image $(IMAGE_REPO):v$(VERSION) && make install-dev
lint:
golangci-lint run --skip-dirs="test"
integration:
bash "test/integration/main.sh" "regular"
alerting:
cd test/integration/alerting && docker build -t securesystemsengineering/alerting-endpoint . && cd -
build-testimage-%:
docker build --build-arg="MESSAGE=$*" -t securesystemsengineering/testimage:$* -f test/testdata/dockerfiles/Dockerfile test/testdata/dockerfiles