问题
I'm trying to put jobs inside a folder using jenkins DSL script Now i create a listView and i put inside my jobs here the code i'm using
listView('MyJobsList') {
jobs {
map.each{
name((it.key).trim())
}
}
columns{
status()
weather()
name()
lastSuccess()
lastFailure()
lastDuration()
buildButton()
}
}
i want to do the same thing but this time i want to put the jobs in a folder !!
回答1:
Please refer the below Job-DSL documentation to create a folder in Jenkins through Job-DSL.
Folder
folder('folder-a') {
description('Folder containing all jobs for folder-a')
}
job('folder-a/job-a') {
// Job config goes here
}
回答2:
Please, take a look at Jenkins filestructure: https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins
Here you can see where jobs are stored by default (job config and build logs). You can not and should not change this filestructure with DSL script (JobDSL plugin).
来源:https://stackoverflow.com/questions/43387792/how-to-put-jobs-inside-a-folder-in-jenkins