简体   繁体   English

Jenkins 多分支与 Jenkinsfile 在不同的仓库中

[英]Jenkins multibranch with Jenkinsfile in different repo

If use a multibranch pipeline in Jenkins, I want to have a build for every specific branch that is made inside my code repo.如果在 Jenkins 中使用多分支管道,我希望为在我的代码存储库中创建的每个特定分支进行构建。 This works like a charm.这就像一个魅力。 But I don't want to provide a Jenkinsfile inside my code repo.但我不想在我的代码仓库中提供 Jenkinsfile。 Instead I want to define a different CI repo which is providing my CI pipeline scripts.相反,我想定义一个不同的 CI 存储库,它提供我的 CI 管道脚本。

The problem is that the usual config is not containing the scm option like in the normal config.问题是通常的配置不像普通配置那样包含 scm 选项。

Normal pipeline config:正常的管道配置:

在此处输入图片说明

Multibranch pipeline config:多分支管道配置:

在此处输入图片说明

Can somebody tell me how to separate the Jenkinsfile from my source code using a multibranch pipeline?有人可以告诉我如何使用多分支管道将 Jenkinsfile 与我的源代码分开吗?

以防万一有人遇到同样的问题,有一个 Jenkins 插件可以为 mutlibranch pipleines 带来远程 Jenkinsfiles: https ://plugins.jenkins.io/remote-file/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM