CI - the basics

The aim and steps for a good Continuous Integration

Press Space to continue

What is Continuous Integration

A way to make code quality!

Test and Deploy fastly and continuously your web application
Stategies: nightly build, on commit, on demand

Phase 1

Get the code

Getting the code every developer has on its IDE. Code should be hosted in a Source Code Management (SCM) like Git, SVN...

Phase 2

Get the libs

Project's libraries should not be hosted in SCM because it is not part of source code, it is only tools that the code uses to run perfectly
There are many tools to download libraries, depending on the project language e.g.: Maven, Composer, Bower, Cocoapods...

Phase 3

Compilation

For languages that compiles code (like Java), this is a part of creating a product. Project must be compiled to be understood by the machine.
This is also a kind of a test: the 1st one.

Phase 4

Test, test and test again

A project without tests is not qualitative. Developer MUST test the application by writing some Unit Tests (UT) and (for very qualitative projects) User Interface Tests (UIT).
So, this phase runs tests and fails Continuous Integration Process if at least 1 test fails.

Phase 5

Create the product

At this phase, we know that the project compiles and is qualitative. We can make a product of the project. The product will be deployed later. A product should be a single file. e.g.: war, jar, phar, zip, tar.gz, rpm, ipa...

Phase 6

Deploy

We have the product. Now, a developer/customer/Product Owner may want to test it. So the product is deployed on a server.

Flow Chart

CI Flow Chart

Release

Use some parts of CI to create a real product, immuable and made for a production environment.

Phase 1

Get the code (CI process)

Getting the code every developer has on its IDE. Code should be hoste in a Source Code Management (SCM) like Git, SVN...

Phase 2

Get the libs (CI process)

Project's libraries should not be hosted in SCM because it is not part of source code, it is only tools that the code uses to run perfectly
There are many tools to download libraries, depending on the project language e.g.: Maven, Composer, Bower, Cocoapods...

Phase 3

Compilation (CI process)

For languages that compiles code (like Java), this is a part of creating a product. Project must be compiled to be understood by the machine.
This is also a kind of a test: the 1st one.

Phase 4

Test, test and test again (CI process)

A project without tests is not qualitative. Developer MUST test the application by writing some Unit Tests (UT) and (for very qualitative projects) User Interface Tests (UIT).
So, this phase a ajout to run tests and fail Continuous Integration Process if at least 1 test fails.

Phase 5

Create the product (CI process)

At this phase, we know that the project compiles and is qualitative. We can make a product of the project. The product will be deployed later. A product should be a single file. e.g.: war, jar, phar, zip, tar.gz, rpm, ipa...

Phase 6

Make the source code immutable

To be sure we can regenerate the product from the source code, you have to make it immutable using tags in SCM.

Phase 6'

Archive the product

Save the product and make it accessible for the team in charge of deploying it in a production environment.

Flow Chart

Release Flow Chart

Where to go from here?

This is the theory

You have to adapt the theory on each project, on each language. Web and mobile projects are differents; PHP and Java are different too!

Any questions?

Github: benjdum59

Website: benjdum59.github.io

Mail: benjamin.dumont.pro@gmail.com



Go to Homepage