-
Notifications
You must be signed in to change notification settings - Fork 4
/
c0117.yml
76 lines (68 loc) · 1.53 KB
/
c0117.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
doc_meta: |
folder: loop
title: multi-layers loop 2
head: |
This showcases that you can use call func to achieve multiple layers of loop
sections:
- title: Demo
log: yes
notes:
goal:
- demo how to do double layered loop
- use call func to achieve that
tasks:
-
name: task
desc: main entry
task:
-
func: call
name: step2
desc: call subtask and exam the return value in following steps
do: subtask
loop:
- proc 1
- proc 2
- proc 3
-
name: subtask
desc: subtask to test reg and return
task:
-
func: cmd
name: step1
desc: the loopitem here is inherited from caller
do:
- name: print
cmd: '{{.loopitem}}'
# -
# func: cmd
# do:
# - name: exit
-
func: cmd
name: step2
desc: the loopitem here is the local defined loopitem
do:
- name: print
cmd: '{{.loopitem}}'
loop:
- item1
- item2
- item3
-
func: cmd
name: step3
desc: |
demo use both loopitem in same context
the dvar parentLoopItem will map the value of parent loopitem
dvars:
- name: parentLoopItem
value: '{{.loopitem}}'
do:
- name: print
cmd: 'parent loop: {{.parentLoopItem}}, child loop: {{.loopitem}}'
loop:
- item1
- item2
- item3