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

     1  notes:
     2    - pre/post task without using finally element
     3  
     4  tasks:
     5    -
     6      name: task
     7      task:
     8        - func: call
     9          do:
    10            - pre_task
    11            - my_task
    12            - post_task
    13  
    14    -
    15      name: pre_task
    16      task:
    17        -
    18          func: cmd
    19          do:
    20            - name: print
    21              cmd: pre-task
    22  
    23    -
    24      name: post_task
    25      task:
    26        -
    27          func: cmd
    28          do:
    29            - name: print
    30              cmd: post-task
    31  
    32    -
    33      name: final_task
    34      task:
    35        -
    36          func: cmd
    37          do:
    38            - name: print
    39              cmd: final-task even there is failure/exception
    40  
    41    -
    42      name: my_task
    43      task:
    44        -
    45          func: cmd
    46          do:
    47            - name: print
    48              cmd: my task step 1
    49            - name: print
    50              cmd: my task step 2
    51  
    52        -
    53          func: shell
    54          desc: |
    55            task fails
    56          do:
    57            - echo "step a - hello"
    58            - echo "step b - hello" |grep "world"
    59            - echo "step c - after the exception"
    60  
    61        -
    62          func: cmd
    63          do:
    64            - name: print
    65              cmd: my task step 3
    66            - name: print
    67              cmd: my task step 4