-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
65 lines (54 loc) · 2.34 KB
/
Copy pathjustfile
File metadata and controls
65 lines (54 loc) · 2.34 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
fetcher_tag := "cmk-rustik-metrics-fetcher:local"
fetcher_target := "metrics-fetcher-dev"
cache_tag := "cmk-rustik-metrics-cache:local"
cache_target := "metrics-cache-dev"
push := ""
push_ott := ""
push_url := ""
site_ca := ""
cluster_host_name := ""
# Build an image for Kubernetes using Docker
dockerize:
docker build -t {{fetcher_tag}} --target {{fetcher_target}} -f docker/Dockerfile .
docker build -t {{cache_tag}} --target {{cache_target}} -f docker/Dockerfile .
# Create a kind cluster for development
kind-create:
sed "s#\\\$SRC_DIR\\\$#$(pwd)#" devel/kind-config.yaml | \
kind create cluster --name rustik --config -
# Load images into the kind cluster, creating it if it does not exist
kind-load:
kind load docker-image {{fetcher_tag}} --name rustik
kind load docker-image {{cache_tag}} --name rustik
# Load the helm chart into the kind cluster with devel/values.yaml
kind-helm-install:
helm upgrade --install cmk-rustik ./charts/cmk-rustik \
-n checkmk-monitoring --create-namespace -f devel/values.yaml \
{{ if path_exists("devel/custom_values.yaml") == "true" { "-f devel/custom_values.yaml" } else { "" } }} \
{{ if push != "" { "--set push.enabled=" + push } else { "" } }} \
{{ if push_ott != "" { "--set push.registrationToken=" + push_ott } else { "" } }} \
{{ if push_url != "" { "--set push.url=" + push_url } else { "" } }} \
{{ if site_ca != "" { \
"--set push.insecureSkipSiteCaVerification=false " + \
"--set-file push.siteCaCertificate=" + site_ca \
} else { "" } \
}} \
{{ if cluster_host_name != "" { "--set clusterHostName=" + cluster_host_name } else { "" } }}
# Delete the helm deployment from the kind cluster
kind-helm-delete:
helm delete cmk-rustik -n checkmk-monitoring
# DEV ENV: Deploy rustik in Kind with source mounted at /src
kind-dev: dockerize kind-create kind-load kind-helm-install
# Remove the Kind dev cluster
kind-dev-teardown:
kind delete cluster --name rustik
# Run kubeconform and ct lint over the helm chart
lint-helm:
helm template ./charts/cmk-rustik/ -f charts/cmk-rustik/ci/ci-values.yaml \
| kubeconform
ct lint --all
# Run a rough subset of what runs in CI
sanity: lint-helm
cargo doc --workspace --no-deps --document-private-items
cargo test
cargo clippy
cargo fmt --check