I agree with all this. Unfortunately I haven't found anything less bad :(
[0] https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
def project = 'quidryan/aws-sdk-test'
def branchApi = new URL("https://api.github.com/repos/${project}/branches")
def branches = new groovy.json.JsonSlurper().parse(branchApi.newReader())
branches.each {
def branchName = it.name
job {
name "${project}-${branchName}".replaceAll('/','-')
scm {
git("git://github.com/${project}.git", branchName)
}
steps {
maven("test -Dproject.name=${project}/${branchName}")
}
}
}
The vocabulary and grammar in that script is quite complicated and people would rather be presented with the options for clicking on a web page. But perhaps you're promoting a particular software product?I think the new Jenkinsfile approach looks very promising: http://jenkins-ci.org/content/pipeline-code-multibranch-work...
Keeping your configs in YAML in source control is such a win. Not a fan of Jenkins, BTW.
[1] https://github.com/gvalkov/jenkins-autojobs [2] http://jenkins-autojobs.readthedocs.org/en/latest/examples.h...