Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`git clone project2` in 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?

like image 778
d33tah Avatar asked Jun 08 '17 20:06

d33tah


People also ask

Can you Git clone from GitLab?

After you successfully clone the GitLab repository, navigate into the newly created gitlab-made-easy folder. Inside you will see a README file, which verifies that the clone operation was successful.

How do I clone a specific branch?

You can clone a specific branch from a Git repository using the git clone –single-branch –branch command. This command retrieves all the files and metadata associated with one branch. To retrieve other branches, you'll need to fetch them later on.


1 Answers

You can also use GIT SUBMODULES within your project A to refer to project B and then add

GIT_SUBMODULE_STRATEGY: recursive

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

like image 137
secustor Avatar answered Nov 15 '22 08:11

secustor