-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (64 loc) · 2.63 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#-[ SETUP ]-------------------------------------------------------------------------------------------------------------
GINKGO_FLAGS := -r \
--procs=1 \
--seed=0 \
--fail-fast \
--fail-on-empty \
--require-suite \
--poll-progress-after=5m \
--poll-progress-interval=1m \
--timeout=30m \
--grace-period=5m
ifeq ($(CI),true)
GINKGO_FLAGS := $(GINKGO_FLAGS) --github-output
endif
ifdef E2E_VERBOSITY # Set E2E_VERBOSITY to "-v" or "-vv" for extra output
GINKGO_FLAGS := $(GINKGO_FLAGS) $(E2E_VERBOSITY)
else
GINKGO_FLAGS := $(GINKGO_FLAGS) --succinct
endif
#-----------------------------------------------------------------------------------------------------------------------
.PHONY: setup
setup:
npm install -g smee-client
go mod download -x
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.0
.PHONY: create-local-cluster
create-local-cluster:
kind create cluster --name devbot --wait "1m"
.PHONY: setup-observability
setup-observability:
./scripts/setup-observability.sh
.PHONY: delete-local-cluster
delete-local-cluster:
kind delete cluster --name devbot || true
#generate: api/v1/zz_generated.application.conditions.go api/v1/zz_generated.constants.go api/v1/zz_generated.deepcopy.go api/v1/zz_generated.deployment.conditions.go api/v1/zz_generated.environment.conditions.go api/v1/zz_generated.repository.conditions.go deploy/chart/crds/devbot.kfirs.com_applications.yaml deploy/chart/crds/devbot.kfirs.com_deployments.yaml deploy/chart/crds/devbot.kfirs.com_environments.yaml deploy/chart/crds/devbot.kfirs.com_repositories.yaml
.PHONY: generate
generate:
go generate ./...
.PHONY: deploy
deploy:
skaffold build -q | skaffold deploy --load-images --build-artifacts -
.PHONY: undeploy
undeploy:
skaffold delete
kubectl delete --all --all-namespaces deployments.devbot.kfirs.com || true
kubectl delete --all --all-namespaces environments.devbot.kfirs.com || true
kubectl delete --all --all-namespaces applications.devbot.kfirs.com || true
kubectl delete --all --all-namespaces repositories.devbot.kfirs.com || true
kubectl get namespaces -oname | grep -v -E 'default|devbot|kube|cert-manager|observability' | sort | xargs -I@ kubectl delete @ || true
kubectl delete namespace devbot || true
kubectl delete crd repositories.devbot.kfirs.com applications.devbot.kfirs.com deployments.devbot.kfirs.com environments.devbot.kfirs.com || true
.PHONY: dev
dev:
skaffold dev
.PHONY: e2e
e2e:
DEVBOT_PREFIX=local-devbot ginkgo run $(GINKGO_FLAGS)
.PHONY: e2e-watch
e2e-watch:
ginkgo watch $(GINKGO_FLAGS)
.PHONY: e2e-unfocus
e2e-unfocus:
ginkgo unfocus