Jenkins JobDSL multibranchPipelineJob change script path

后端 未结 4 1059
天涯浪人
天涯浪人 2021-02-18 13:04

I am trying to create a multibranchPipelineJob in jobDSL, however the Jenkinsfile is at an alternative location to the default. I have looked through the docs https://jenkinsci

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-18 13:46

    After a fair amount of googling, I found something that works:

    configure {
        it / factory(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory') {
            owner(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject', reference: '../..')
            scriptPath("jenkins/[where ever you want]/Jenkinsfile")
        }
    }
    

    This seems to work for me.

提交回复
热议问题