yaml - Using Similar "suites" in Test Kitchen for Code Reuse? -


how can re-use of attributes section, except maven

     suites:        - name: dev       attributes:            'ant': &ant             'version': '1.9.3'             'home': '/my/path/ant'           'maven':               'version': 3             'm2_home': '/my/path/maven'             '3':                'version': '3.2.1'               'maven_rc':              'opts': '' 

for testing instance, inherit of above attributes, except maven, i'd override (different version):

    - name: testing       attributes:             <<: *ant        # re-use ant it's same configuration           'maven':        # different version testing             'version': 3             'm2_home': '/my/path/maven'             '3':                'version': '3.0.5'               'maven_rc':              'opts': '' 

you want edit .kitchen.yml under platform attributes want universal. if change them put them under suites section different value.

platforms:   - name: ubuntu-12.04     driver_config:       box: ubuntu-12.04     run_list:       - recipe[apt::default]     attributes:       ant: &ant         version: '1.9.3'         home: '/my/path/ant'       maven:         version: 3         m2_home: '/my/path/maven'         3:           version: '3.2.1'           maven_rc:         opts: ''  suites:   - name: default     run_list:       - recipe[cookbook::default]     attributes:    - name: testing     run_list:       - recipe[cookbook::default]     attributes:       maven:         3:           version: '3.0.5' 

you can access attributes inside recipes calling node['maven']['version'] retrieve current value change depending if overwritten in suites section.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -