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

     1  
     2  flow:
     3        -
     4          func: cmd
     5          vars:
     6            school_name: sydney grammar
     7            school_address: 1 fox road, sydney, nsw 2000
     8            schoo_principals:
     9              - peter
    10              - tom
    11              - jane
    12            schoo_ranking: No 5
    13          dvars:
    14            - name: school_string
    15              desc: use default expand == 1
    16              value: '{{.complex_data_structure_template}}'
    17          do:
    18            - name: print
    19              cmd: '{{.school_string}}'
    20  
    21        -
    22          func: cmd
    23          vars:
    24            school_name: sydney grammar
    25            school_address: 1 fox road, sydney, nsw 2000
    26            schoo_principals:
    27              - peter
    28              - tom
    29              - jane
    30            schoo_ranking: No 5
    31          dvars:
    32            - name: school_yml
    33              desc: use dynamic expand == 2, so that the template will be rendered
    34              value: '{{.complex_data_structure_template}}'
    35              expand: 2
    36              flags: [reg]
    37          do:
    38            - name: print
    39              cmd: '{{.school_yml}}'
    40  
    41        -
    42          func: cmd
    43          desc: |
    44            show global school_yml var
    45            convert the yml to object so that it could be used in template later
    46          dvars:
    47            - name: school_details
    48              desc: use dynamic expand == 2, so that the template will be rendered
    49              value: '{{.school_yml}}'
    50              flags: [vvv, toObj, reg]
    51          do:
    52            - name: print
    53              cmd: '{{.school_yml}}'
    54            - name: printObj
    55              cmd: 'school_details'
    56            - name: print
    57              cmd: '{{.school_details}}'
    58            - name: printObj
    59              cmd: 'school_details_object'
    60