-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathTaskfile.yml
106 lines (90 loc) · 2.84 KB
/
Taskfile.yml
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
105
106
version: "3"
silent: true
vars:
CLUSTER_NAME: sas-policy-cluster
APP_NAME: k3d-sas-policy
HELM_VERS: v3.8.0
KUBECTL: kubectl --context k3d-{{.CLUSTER_NAME}}
RESET: \033[0m
BLACK: \033[:0;30m
RED: \033[:0;31m
GREEN: \033[:0;32m
tasks:
test:all:
prefix: test
desc: run all tests
cmds:
- task: constraint:config
- task: test:alice
- task: test:bob
- task: test:tom
delete:all:
prefix: delete
desc: delete all tests
cmds:
- task: delete:alice
- task: delete:bob
- task: delete:tom
constraint:config:
prefix: constraint > configure
desc: configure and apply template.yaml and examples/constraint.yaml
cmds:
- cmd: "{{.KUBECTL}} apply -f template.yaml"
- "sleep 15"
- |
{{.KUBECTL}} apply -f examples/constraint.yaml
- "sleep 15"
test:alice:
prefix: test < alice
desc: test user with label set to true and sas image, should not create pod
cmds:
- cmd: "{{.KUBECTL}} create ns alice"
ignore_error: true
- cmd: "{{.KUBECTL}} apply -f examples/alice/pod.yaml"
ignore_error: true
- cmd: "{{.KUBECTL}} apply -f examples/alice/notebook.yaml"
ignore_error: true
delete:alice:
prefix: delete < alice
desc: delete alice pod and notebook
cmds:
- cmd: "{{.KUBECTL}} delete -f examples/alice/pod.yaml"
ignore_error: true
- cmd: "{{.KUBECTL}} delete -f examples/alice/notebook.yaml"
ignore_error: true
test:bob:
prefix: test < bob
desc: test user with label set to true and non-sas image, should create pod and notebook
cmds:
- cmd: "{{.KUBECTL}} create ns bob"
ignore_error: true
- cmd: "{{.KUBECTL}} apply -f examples/bob/pod.yaml"
ignore_error: true
- cmd: "{{.KUBECTL}} apply -f examples/bob/notebook.yaml"
ignore_error: true
delete:bob:
prefix: delete < bob
desc: delete bob pod and notebook
cmds:
- cmd: "{{.KUBECTL}} delete -f examples/bob/pod.yaml"
ignore_error: true
- cmd: "{{.KUBECTL}} delete -f examples/bob/notebook.yaml"
ignore_error: true
test:tom:
prefix: test < tom
desc: test user with label set to false and sas image, should create pod and notebook
cmds:
- cmd: "{{.KUBECTL}} create ns tom"
ignore_error: true
- cmd: "{{.KUBECTL}} apply -f examples/tom/pod.yaml"
ignore_error: true
- cmd: "{{.KUBECTL}} apply -f examples/tom/notebook.yaml"
ignore_error: true
delete:tom:
prefix: delete < tom
desc: delete tom pod and notebook
cmds:
- cmd: "{{.KUBECTL}} delete -f examples/tom/pod.yaml"
ignore_error: true
- cmd: "{{.KUBECTL}} delete -f examples/tom/notebook.yaml"
ignore_error: true