Wasim
Wasim

Reputation: 61

Jenkins: can we do 'continuous integration' if we have code in two different GitLab repository?

For Example in my case: I have two repositories on GitLab.

1- Repository A: which contains the project code in ROR.

2- Repository B: which contains the selenium-java code(web automation).

I want to apply continuous integration. Meaning, my test cases should execute which are in Repository B, if Repository A is updated.

Is there a way to do it?

Upvotes: 4

Views: 139

Answers (1)

Oren Chapo
Oren Chapo

Reputation: 519

Yes, you can:

  1. Create a single (scripted) pipeline job.
  2. Use the "snippet generator" to generate "checkout" groovy code for Repository A. Make sure "Include in polling?" is checked, and checkout to a specific sub-folder.
  3. Use the "snippet generator" again to generate "checkout" groovy code for Repository B. Make sure "Include in polling?" is not checked, and checkout to a specific sub-folder other than the one specified in previous step.
  4. Add additional step (sh/bat or other) to build your project.
  5. Add additional step (sh/bat or other) to build your tests.
  6. Add additional step (sh/bat or other) to execute your tests.
  7. Bonus: you can use multiple build nodes to run steps 4 and 5 in parallel and save some time.

I'm using the above practice successfully with several SVN repositories in my production CI environment.

Upvotes: 2

Related Questions