Jenkins:一个项目的多个 Git 存储库 [英] Jenkins: Multiple Git repositories for one project

查看:52
本文介绍了Jenkins:一个项目的多个 Git 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用两个 Git 存储库构建一个项目.其中一个包含源代码,而另一个包含构建和部署脚本.

I want to build a project using two Git repositories. One of them contains of the source code, while the other has the build and deployment scripts.

我的问题是我需要有一个存储库来构建和部署项目的不同部分(大项目、多个存储库、相同的构建和部署脚本),但 Jenkins 似乎无法处理这个(或我不知道/没有找到如何).

My problem is that I need to have a repository for building and deployment of different parts of the project (big project, multiple repositories, same build and deployment scripts), but Jenkins does not seem to be able to handle this (or I don't know/didn't find how).

推荐答案

UPDATE

多 SCM 插件现已弃用,因此用户应迁移到 Pipeline 插件.

Multiple SCMs Plugin is now deprecated so users should migrate to Pipeline plugin.

旧答案

是的,Jenkins 可以解决这个问题.只需在源代码管理下使用 Multiple SCM,添加您的存储库,然后转到每个存储库的高级部分.这里需要设置本地子目录repo(可选)Unique SCM name(可选).

Yes, Jenkins can handle this. Just use Multiple SCMs under Source Code Management, add your repositories and then go to the Advanced section of each repository. Here you need to set Local subdirectory for repo (optional) and Unique SCM name (optional).

您的存储库将被拉到您设置的本地子目录中,这样您就可以按照您想要的任何顺序构建它们.

Your repository will be pulled to the Local subdirectory which you have set so then you can build them in any order you want.

根据 harish 的答案更新 - 您需要安装 Multiple SCMs Plugin 以实现此功能.

Updating per harishs answer - you need to install Multiple SCMs Plugin in order to achieve this functionality.

这篇关于Jenkins:一个项目的多个 Git 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆