-
Notifications
You must be signed in to change notification settings - Fork 4
/
c0189.yml
68 lines (62 loc) · 1.59 KB
/
c0189.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
doc_meta: |
folder: flow-controll
title: task finally always emit
head: |
Showcases that the finally block will be always fired even there is no exception / error
sections:
- title: Demo
log: yes
related:
refs:
- title: shell func
link: ../../quick-start/c0002/
- title: error handling
link: ../../test-debug/error_handling/
- title: finally and rescue
link: ../../flow-controll/c0174/
- title: finally block
link: ../../flow-controll/c0183/
- title: finally block
link: ../../flow-controll/c0184/
- title: finally block
link: ../../flow-controll/c0187/
- title: finally block
link: ../../flow-controll/f0188/
- title: finally block
link: ../../flow-controll/f0185/
- title: finally block
link: ../../flow-controll/f0186/
notes:
- add finally support to tasks level
vars:
global_aa: aa
tasks:
-
name: task
task:
-
func: shell
vars:
local_bb: bb
dvars:
- name: task_tt
value: tt
flags: [taskScope]
name: step1
desc: step 1
do:
- echo "opening file"
desc: |
without rescue, the execution will return a non-zero return code in shell and also report the error
with rescue, the program will return 0
rescue: true
finally:
-
func: shell
vars:
finally_cc: cc
name: close_file
desc: |
ensure the opened file is closed
do:
- echo "close the file ....."