Created
March 13, 2017 21:06
-
-
Save cdenneen/92e6dec318b08cc63b163ef3c001e59f to your computer and use it in GitHub Desktop.
Jenkins Multiconfiguration Job with Dynamic Axis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matrixJob('shared/jobs/build/puppet unit') { | |
logRotator(-1, 5, -1, -1) | |
parameters { | |
stringParam('RUBY_VERSIONS', '2.1.9 2.3.3', 'Ruby version to select') | |
stringParam('PUPPET_VERSIONS', '4.7.0 4.8.1', 'Puppet version to select') | |
} | |
axes { | |
label('puppet') | |
dynamicAxis('RUBY_VERSION','$RUBY_VERSIONS') | |
dynamicAxis('PUPPET_GEM_VERSION','$PUPPET_VERSIONS') | |
labelAxis('puppet') | |
} | |
combinationFilter('(RUBY_VERSION=="2.1.9" && PUPPET_GEM_VERSION=="4.7.0")||(RUBY_VERSION=="2.1.9" && PUPPET_GEM_VERSION=="4.8.1")||(RUBY_VERSION=="2.3.3" && PUPPET_GEM_VERSION=="4.7.0")||(RUBY_VERSION=="2.3.3" && PUPPET_GEM_VERSION=="4.8.1")') | |
concurrentBuild() | |
label('puppet') | |
steps { | |
shell(''' | |
#!/bin/bash | |
. /usr/local/rvm/scripts/rvm; rvm use ${RUBY_VERSION} | |
echo | |
echo Ruby Version Selected: | |
ruby -v | |
echo | |
echo Install Bundler: | |
gem install bundler --no-ri --no-rdoc | |
echo | |
[ -d '.bundle' ] && rm -rf .bundle | |
[ -f 'Gemfile.lock' ] && rm Gemfile.lock | |
bundle install --path .bundle --without system_tests --without development --jobs 2 | |
status=0 | |
echo Running Unit tests: | |
STRICT_VARIABLES=no bundle exec rake spec | |
rc=$?; if [[ $rc != 0 ]]; then status=$rc; fi | |
exit $status | |
''') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment