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

     1  doc_meta: |
     2    folder: flow-controll
     3    title: dynamic routing extra
     4    head: |
     5      This case shows that you can use combination of if statement and a var reference in your callee task name
     6  
     7    sections:
     8      - title: Demo
     9        log: yes
    10  
    11  notes:
    12    goal:
    13      - add feature of dynamic call routing
    14      - show a little dynamic using if
    15  
    16  tasks:
    17  
    18    - name: task
    19      task:
    20  
    21        - func: call
    22          vars:
    23            person:
    24              name: tom
    25              age: 23
    26          do:
    27            - '{{.person.name}}_action'
    28          if: '{{gt .person.age 20}}'
    29  
    30    - name: tom_action
    31      task:
    32        - func: cmd
    33          do:
    34            -
    35              name: print
    36              cmd: 'hello {{.person.name}}'