gitlab-ci.yml中的`git clone project2`吗? [英] `git clone project2` in gitlab-ci.yml?
本文介绍了gitlab-ci.yml中的`git clone project2`吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望Gitlab CI可以获取另一个项目的源代码.有没有比添加只读部署密钥并在.gitlab-ci.yml中进行设置更好的方法了?
I'd like Gitlab CI to fetch source code of another project. Is there a better way than adding a read-only deploy key and setting it up in .gitlab-ci.yml?
推荐答案
您也可以使用项目A中的GIT子模块引用项目B,然后添加
You can also use GIT SUBMODULES within your project A to refer to project B and then add
GIT_SUBMODULE_STRATEGY: recursive
到项目A中的gitlab-ci.yml文件.
to the gitlab-ci.yml file in project A.
这还使您能够专门包括子项目中的特定分支或提交.
This also enables you to specifically include a specific branch or commit from your subproject.
https://docs.gitlab.com/ce/ci/git_submodules.html
这篇关于gitlab-ci.yml中的`git clone project2`吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文