Skip to content

Instantly share code, notes, and snippets.

@kyounger
Created October 27, 2015 02:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kyounger/83134869ea523b3661f0 to your computer and use it in GitHub Desktop.
Save kyounger/83134869ea523b3661f0 to your computer and use it in GitHub Desktop.
Jenkins Job DSL - example of nested view loop
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