-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
104 lines (86 loc) · 2.4 KB
/
Taskfile.yml
File metadata and controls
104 lines (86 loc) · 2.4 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
103
104
# https://taskfile.dev
version: '3'
vars:
CLUSTER_NAME: "cluster"
APP_NAMESPACE: "apps"
includes:
cluster:
taskfile: kind/Taskfile.yml
dir: kind
internal: true
monitoring:
taskfile: monitoring/Taskfile.yml
dir : monitoring
internal: true
istio:
taskfile: istio/Taskfile.yml
dir: istio
internal: true
apps:
taskfile: app/k8s/Taskfile.yml
dir: app/k8s
internal: true
k6:
taskfile: k6/Taskfile.yml
dir: k6
internal: true
tasks:
check-tools:
desc: "Check if Docker, Kind, and Helm are installed"
preconditions:
- sh: command -v docker
msg: "Docker is not installed. Please install Docker to proceed."
- sh: command -v kind
msg: "Kind is not installed. Please install Kind to proceed."
- sh: command -v helm
msg: "Helm is not installed. Please install Helm to proceed."
cmds:
- echo "All required tools (Docker, Kind, Helm) are installed."
create-gateways:
desc: Create Gateways
internal: true
cmds:
- task: monitoring:create-gateways
- task: istio:create-gateways
messages:
desc: Show the messages
internal: true
silent: true
vars:
APPS: proxy kiali grafana
cmds:
- for: { var: APPS }
cmd: echo -e "\n \n add 127.0.0.1 {{.ITEM}}.local to /etc/hosts"
create:
desc: Create a kind cluster
deps:
- check-tools
cmds:
- task: cluster:create-kind-cluster
- task: monitoring:install-monitoring
- task: istio:create-istio
- task: create-gateways
- task: apps:deployApps
- task: k6:deploy-k6-operator
- task: messages
logs-*:
desc: Print logs for the app with arguments [appName]
vars:
APP_NAME: '{{index .MATCH 0}}'
cmds:
- kubectl -n {{.APP_NAMESPACE}} logs -l app={{.APP_NAME}} -f
test-*-*-*:
desc: Run a test with arguments [sleep, count, scenarioLetter]
preconditions:
- sh: kubectl -n apps get deploy | grep app-a
msg: The deployments are not found. Please deploy the deployments to proceed.
vars:
SLEEP: '{{index .MATCH 0}}'
COUNT: '{{index .MATCH 1}}'
LETTER: '{{index .MATCH 2}}'
cmds:
- curl http://proxy.local/scenario{{.LETTER}}\?delay\={{.SLEEP}}\&requestCount\={{.COUNT}}
clean:
desc: Delete the kind cluster
cmds:
- task: cluster:clean