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

     1  doc_meta: |
     2    folder: dvars
     3    title: load from refdir
     4    head: |
     5      By default when you use ref tag to load dvar value from a file, it will use the default refdir from cli command line args, however this could be overriden using the refdir tag in dvar config
     6  
     7    sections:
     8      - title: how does it work?
     9        content: |
    10          By default the the refdir should be from below command line, its value will be: ./tests/functests
    11  
    12          ```
    13          up ngo -d ./tests/functests -t $1 -i dev -v vvvv --configdir=./tests/functests
    14          ```
    15  
    16          In this case, the refdir is overriden using your own customised location
    17  
    18      - title: Relavant
    19        content: load task using refdir
    20        refs:
    21          - title: externalise task and use refdir
    22            link: ../../organization/c0089
    23  
    24      - title: Demo
    25        log: yes
    26  
    27  
    28  notes:
    29    goal:
    30      - to test out dvars object can be loaded from a dynamic ref dir
    31  
    32  vars:
    33    student:
    34      name: Tom
    35      gender: Male
    36      address:
    37        suburb:
    38          name: sydney
    39          postcode: 2000
    40          CBD: yes
    41        school: Sydney Grammar
    42  
    43  tasks:
    44  
    45    -
    46      name: task
    47      desc: use dynamic dir instead of static ref dir
    48      task:
    49        -
    50          func: shell
    51          vars:
    52            dynadir: ./tests/functests
    53          dvars:
    54            - name: sgp_address_dyna_dir
    55              ref: d0030_school.yml
    56              refdir: '{{.dynadir}}'
    57              flags: [toObj, vvvv]
    58  
    59          do:
    60            - echo """1.address -> \n{{.sgp_address_dyna_dir}}"""
    61            - echo """1.address object-> \n{{.sgp_address_dyna_dir_object}}"""