-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
65 lines (55 loc) · 1.9 KB
/
Taskfile.yaml
File metadata and controls
65 lines (55 loc) · 1.9 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
version: "3"
vars:
ENVIRONMENT: '{{.ENVIRONMENT | default "dev"}}'
tasks:
default:
desc: Show available tasks
cmds:
- task --list
# === Validation ===
lint:yaml:
desc: Run yamllint on all YAML files
cmds:
- yamllint -c .yamllint.yaml .
kustomize:build:
desc: Build all Kustomize overlays (all environments)
cmds:
- |
echo "Building all Kustomize overlays..."
find . -path '*/overlays/*/kustomization.yaml' -exec dirname {} \; | while read dir; do
echo "Building $dir ..."
kustomize build --enable-helm "$dir" > /dev/null || exit 1
done
echo "All overlays built successfully."
kustomize:build:env:
desc: "Build overlays for ENVIRONMENT (default: dev)"
cmds:
- |
echo "Building {{.ENVIRONMENT}} overlays..."
find . -path "*/overlays/{{.ENVIRONMENT}}/kustomization.yaml" -exec dirname {} \; | while read dir; do
echo "Building $dir ..."
kustomize build --enable-helm "$dir" > /dev/null || exit 1
done
echo "All {{.ENVIRONMENT}} overlays built successfully."
validate:
desc: Run all validations (lint + build)
deps: [lint:yaml, kustomize:build]
cmds:
- echo "All validations passed."
# === Rendering ===
render:
desc: "Render overlays to rendered/ directory for ENVIRONMENT (default: dev)"
cmds:
- |
mkdir -p rendered
echo "Rendering {{.ENVIRONMENT}} overlays..."
find . -path "*/overlays/{{.ENVIRONMENT}}/kustomization.yaml" -exec dirname {} \; | while read dir; do
name=$(echo "$dir" | sed 's|^\./||' | tr '/' '-')
echo "Rendering $dir ..."
kustomize build --enable-helm "$dir" > "rendered/${name}.yaml" || exit 1
done
echo "All {{.ENVIRONMENT}} overlays rendered to rendered/"
clean:
desc: Remove rendered output
cmds:
- rm -rf rendered/