github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0182.yml (about)

     1  doc_meta: |
     2    folder: flow-controll
     3    title: final step using block
     4    head: |
     5      It is a option to use the block instead of callee task. How you use it is a style preference
     6  
     7    sections:
     8      - title: Demo
     9        log: yes
    10  
    11    related:
    12      refs:
    13        - title: shell func
    14          link: ../../quick-start/c0002/
    15        - title: error handling
    16          link: ../../test-debug/error_handling/
    17        - title: shell step fails
    18          link: ../../flow-controll/f0171/
    19        - title: shell step fails
    20          link: ../../flow-controll/c0172/
    21  
    22  tasks:
    23  
    24    -
    25      name: task
    26      task:
    27  
    28        -
    29          func: cmd
    30          desc: step 1
    31          do:
    32            - name: print
    33              cmd: step 1
    34            - name: panic
    35            - name: print
    36              cmd: extra step ......... it will never reach here
    37          rescue: true
    38          finally:
    39            -
    40              func: shell
    41              name: close_file
    42              desc: |
    43                ensure the opened file is closed
    44              do:
    45                - echo "close the file ....."
    46  
    47        -
    48          func: cmd
    49          desc: step 2
    50          do:
    51            - name: print
    52              cmd: step 2