Difference between revisions of "Continuous Integration: FAQ"

From Gcube Wiki
Jump to: navigation, search
Line 14: Line 14:
 
# as Maven multi-module project
 
# as Maven multi-module project
  
A good way to start with is to create a Git repo for each Eclipse project. So, if you have a multi-module project with Maven, a single Git repo will work fine. The same is for the single component. The basic idea is that the POM in the root folder of the Git repo should build and deploy all the artifacts held in the Git repository.
+
A good way to start with is to create a Git repo for each Eclipse project. So, if you have a multi-module project with Maven, a single Git repo will work fine. The same is for the single component. The basic idea is that the POM in the root folder of the Git repo should build and deploy all the artifacts held in the Git repository. Jenkins also benefits from this type of structure because it just needs to invoke the root POM.
 +
 
 +
Aggregating modules logically connected into a single Maven multi-module project is recommended, whenever possible. It helps reduce the number of Git repositories and Jenkins projects, towards a better sustainability of the integration and delivery procedures.

Revision as of 02:49, 28 June 2019

Q: What do I keep in a Git Repository?

A: For a correct answer, we first need to point out a fundamental difference between SVN and Git:

  • In SVN, there is one single repository, whose structure is equivalent to a file system. You can check out and work at any level of the SVN tree.
  • In Git, there are several repositories, independent from each other. You need to clone an entire repository to work on its content.

Given that, a multi-module Git repository (i.e. a repositories with several modules not grouped in a reactor build of a parent pom) is strongly discouraged. Such repository would force a developer to clone the entire repo, regardless the module he/she would work on. Also Jenkins would be in the same situation: clone a full repo to then build just a small piece of it.

Therefore, there are two ways to structure the content of a Git repository:

  1. as single software component
  2. as Maven multi-module project

A good way to start with is to create a Git repo for each Eclipse project. So, if you have a multi-module project with Maven, a single Git repo will work fine. The same is for the single component. The basic idea is that the POM in the root folder of the Git repo should build and deploy all the artifacts held in the Git repository. Jenkins also benefits from this type of structure because it just needs to invoke the root POM.

Aggregating modules logically connected into a single Maven multi-module project is recommended, whenever possible. It helps reduce the number of Git repositories and Jenkins projects, towards a better sustainability of the integration and delivery procedures.