How to put jobs inside a folder in jenkins?

雨燕双飞 提交于 2019-12-10 14:36:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!