Skip to content

Allow variables with arbitrary yaml list/map structures #489

@ghenzler

Description

@ghenzler

Currently we only support a simple DEF statement on one line, and either strings or simple arrays can be defined:

- DEF basePath=basePath
- DEF sites=[site1,site2,site3]

To allow for more complex structures, a multi-line DEF shall be made possible using =::

# list
- DEF simpleArray=:
     - val1
     - val2
     - val3
- FOR loopVar IN ${simpleArray}:    
       - group-${loopVar}:   
          - name: "Group ${loopVar}"

# list of objects
- DEF listOfMaps=:
     - key1: obj1val1
       key2: obj1val2
       key3: obj1val3
     - key1: obj2val1
       key2: obj2val2
       key3: obj2val3
- FOR loopVar IN ${listOfMaps}:  
    - group-${loopVar.key1}: 
       - name: "Group ${loopVar.key2} ${loopVar.key3}"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions