我们有来自单个git服务器的450个git存储库,我们希望克隆它们并在Jenkins中将它们(下次继续)用于构建目的。
通过Multiple-SCM配置Jenkins插件是手动过程,因为我们需要输入每个存储库URL 因此,是否有任何其他插件可用于将我的所有450个存储库放在一个地方(或)任何可用的命令/脚本? 请建议。
答案 0 :(得分:2)
如Checkout multiple git repos into same Jenkins workspace中所述,您现在(2017)需要使用Pipeline+Plugin才能在同一作业中构建多个Git仓库。
管道背后的想法是你可以将它作为file (called jenkinsfile)存储在它自己的Git仓库中,并定义一个 Jenkins工作(类型"管道"),将寻找Jenkinfile
使用dir
基本步骤查看this example:
dir: Change current directory
更改当前目录
dir
块内的任何步骤都将此目录用作当前目录,任何相对路径都将使用它作为基本路径。
同一个示例使用知道如何gradle的build multiple projects。
OP Mohan S.使用-C
option I mentioned here:
以下命令有效。
git -C mohan_test pull || git clone -b mohan_branch --single-branch ssh://mohan.s@100.101.102.103:29418/mohan_test mohan_test –