简体   繁体   English

在一个 jenkins 管道中管理多个微服务 git repos

[英]Manage Multiple Microservices git repos in one jenkins pipeline

I have 25 git repos having java spring boot code.我有 25 个带有 java spring 启动代码的 git 存储库。 I am using Jenkinsfile to run pipeline and have put the file under root of all repos.我正在使用 Jenkinsfile 运行管道并将文件放在所有存储库的根目录下。

I am currently using "Pipeline script from SCM" in pipeline project and added 25 repos in that (check image).我目前在管道项目中使用“来自 SCM 的管道脚本”,并在其中添加了 25 个存储库(检查图像)。 added git webhook as well.还添加了 git webhook。 But when there is git commit in 2 or 3 repos simultaneously, it only process first one.但是当同时在 2 或 3 个 repos 中有 git commit 时,它只处理第一个。 I run the job manually for other changes.我手动运行作业以进行其他更改。

I want if we run the pipeline it should pickup all changes from all repos and run the pipeline from SCM's jenkinsfile.我希望如果我们运行管道,它应该从所有存储库中获取所有更改并从 SCM 的 jenkinsfile 运行管道。

在此处输入图片说明

In that case it would be easier to just have one repository with the jenkinsfile (like a ci/cd repository).在这种情况下,只拥有一个带有 jenkinsfile 的存储库(如 ci/cd 存储库)会更容易。 You then just use the git step for all repositories you want to build.然后,您只需对要构建的所有存储库使用 git 步骤。

If you only want to build the repository that changed you might want to use webhooks and only build the repo url you received as a parameter.如果您只想构建已更改的存储库,您可能需要使用 webhooks 并仅构建您作为参数收到的 repo url。

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

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