Created
October 27, 2015 02:55
-
-
Save kyounger/83134869ea523b3661f0 to your computer and use it in GitHub Desktop.
Jenkins Job DSL - example of nested view loop
This file contains 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
def jobNames = [ | |
'job1', | |
'job2', | |
'job3', | |
'job4' | |
] | |
def branches = [ | |
'master', | |
'v1', | |
'v2', | |
'v3' | |
] | |
nestedView('main-view') { | |
branches.each { branchName -> | |
views { | |
nestedView('jobs-for-' + branchName) { | |
views { | |
listView(branchName + '-jobs') { | |
jobs { | |
jobNames.each { jobName -> | |
name(jobName) | |
} | |
} | |
columns { | |
status() | |
weather() | |
name() | |
lastSuccess() | |
lastFailure() | |
lastDuration() | |
buildButton() | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment