Jenkins Workflow Multibranch允许指定Jenkinsfile路径 [英] Jenkins Workflow Multibranch allow for specifying Jenkinsfile path
问题描述
现在看来,使用Multibranch类型时,您只能在项目中的单个位置拥有一个Jenkinsfile.
It seems like now you can only have a single Jenkinsfile in a single location in your project when using Multibranch type.
有没有一种配置方法,因此我可以将Jenkinsfile放置在项目根目录下以外的其他位置,并以Jenkinsfile命名.希望,因为有固定配置选项,也许这是将来的功能,但是我非常感谢该选项,因为在当前情况下,由于没有这样的选项,因此我无法选择将所有内容作为一个经过良好编译的管道来运行回购的大小.我正在考虑对同一个存储库进行多个Jenkins作业.
Is there a way to configure so I can place the Jenkinsfile somewhere else than in the root of the project under the name Jenkinsfile. There's hope, as there's an option of Fixed Configuration, maybe this is a feature for the future, but I would much appreciate the option, as in the current situation I do not have the option to run everything as one nicely compiled pipeline due to the size of the repo. I'm thinking of having multiple Jenkins jobs against the same repository.
-马库斯
推荐答案
从管道开始:Multibranch插件版本2.15,可以在配置中指定Jenkinsfile位置.
Starting with Pipeline: Multibranch plugin version 2.15, you can specify the Jenkinsfile location in your configuration.
请参见 https://stackoverflow.com/a/45172149/2141666 上的回答,以及 https://wiki.jenkins.io/display/JENKINS/Pipeline+Multibranch+Plugin .从变更日志中:
See my answer at https://stackoverflow.com/a/45172149/2141666 and the plugin changelog at https://wiki.jenkins.io/display/JENKINS/Pipeline+Multibranch+Plugin. From the changelog:
2.15(2017年6月1日)
2.15 (Jun 01, 2017)
JENKINS-34561用于选择Jenkinsfile以外的脚本名称/路径的选项.
JENKINS-34561 Option to select a script name/path other than Jenkinsfile.
这篇关于Jenkins Workflow Multibranch允许指定Jenkinsfile路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!