-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (76 loc) · 2.99 KB
/
Copy pathMakefile
File metadata and controls
102 lines (76 loc) · 2.99 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.PHONY: all build release test lint fmt doc audit clean
.PHONY: images container kind-up kind-down smoke-test test-integration
.PHONY: dev-env dev-push dev-integration
# ---------------------------------------------------------------------------
# Environment
# ---------------------------------------------------------------------------
KIND_CLUSTER_NAME ?= praxis-extproc
EXTPROC_IMAGE ?= praxis-extproc:dev
KUBECTL ?= kubectl --context kind-$(KIND_CLUSTER_NAME)
# ---------------------------------------------------------------------------
# Build
# ---------------------------------------------------------------------------
all: build fmt lint test audit
build:
cargo build
release:
cargo build --release
# ---------------------------------------------------------------------------
# Quality
# ---------------------------------------------------------------------------
lint:
cargo clippy --all-targets -- -D warnings
cargo +nightly fmt --all -- --check
fmt:
cargo +nightly fmt --all
doc:
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items
audit:
cargo audit
cargo deny check
clean:
cargo clean
# ---------------------------------------------------------------------------
# Test
# ---------------------------------------------------------------------------
test:
cargo test
test-integration:
cargo test --features integration -- --ignored $(if $(V),--nocapture,)
# ---------------------------------------------------------------------------
# Container
# ---------------------------------------------------------------------------
container:
podman build -t $(EXTPROC_IMAGE) -f Containerfile . || \
docker build -t $(EXTPROC_IMAGE) -f Containerfile .
images:
docker build -t $(EXTPROC_IMAGE) -f Containerfile .
# ---------------------------------------------------------------------------
# KIND
# ---------------------------------------------------------------------------
kind-up: images
KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) \
EXTPROC_IMAGE=$(EXTPROC_IMAGE) \
bash hack/setup-kind.sh
kind-down:
KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) \
bash hack/teardown-kind.sh
smoke-test:
KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) \
bash hack/smoke-test.sh
# ---------------------------------------------------------------------------
# Iterative Development
# ---------------------------------------------------------------------------
dev-env: images
KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) \
EXTPROC_IMAGE=$(EXTPROC_IMAGE) \
bash hack/setup-kind.sh
dev-push:
docker build -t $(EXTPROC_IMAGE) -f Containerfile .
kind load docker-image $(EXTPROC_IMAGE) --name $(KIND_CLUSTER_NAME)
$(KUBECTL) -n praxis-extproc rollout restart deployment/praxis-extproc
$(KUBECTL) -n praxis-extproc rollout status deployment/praxis-extproc --timeout=120s
dev-integration:
@kind get kubeconfig --name $(KIND_CLUSTER_NAME) > /tmp/kind-$(KIND_CLUSTER_NAME).kubeconfig
KUBECONFIG=/tmp/kind-$(KIND_CLUSTER_NAME).kubeconfig \
cargo test --features integration -- --ignored $(if $(V),--nocapture,)