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

     1  doc_meta: |
     2    folder: dvars
     3    title: externalize settings
     4    head: |
     5      You can load dvars from a file. The configuration file will look much cleaner if you externalize the dvars settings
     6  
     7    sections:
     8  
     9      - title: d0028_smart_guy.yml reference
    10        filelookup: d0028_smart_guy.yml
    11      - title: d0028_school.yml reference
    12        filelookup: d0028_school.yml
    13  
    14      - title: Demo
    15        log: yes
    16  
    17  notes:
    18    goal:
    19      - load dvar value from a file
    20  
    21  vars:
    22    student:
    23      name: Tom
    24      gender: Male
    25      address:
    26        suburb:
    27          name: sydney
    28          postcode: 2000
    29          CBD: yes
    30        school: Sydney Grammar
    31  
    32  
    33  dvars:
    34    - name: a_smart_guy
    35      ref: d0028_smart_guy.yml
    36      flags: [toObj,]
    37  
    38    - name: school_address
    39      ref: d0028_school.yml
    40      flags: [toObj,]
    41  
    42  tasks:
    43  
    44    - name: task
    45      task:
    46        -
    47          func: shell
    48          do:
    49            - echo """a smart guy=>{{.a_smart_guy}}"""
    50            - echo """postcode=>{{.student.address.suburb.postcode}}"""
    51            - echo """school address {{.school_address}}"""
    52            - echo """this guy is in =>{{.a_smart_guy_object.school}} school"""
    53            - echo """wrong ref here {{.school_address_object.suburb.name}}"""
    54            - echo """school address object -> {{.school_address_object.address.suburb.name}}"""