Continuous Integration in web projects

Hello

After a few days, I have some information about CI (continuous integration) in gitlab.

If you are interested in gitlab as a tool to manage your project commits please visit the official site. GITLAB

So, to enable this feature you need to configure two sides. The project config file and the runner machine.

In the project is necessary to create a config file named .gitlab-ci.yml a config file in yaml  format. the main concept to handle in this par is the stage a block of code with a script to execute a bash or shell command in the server machine, Common stages are build, test and deploy. Find a example in this link.

Save and submit the file to the main project branch (master or develop).
continue
Next part is configure a gitlab runner machine. Exist two forms shared and specific.

Specific runners could be configurable, only needs to install gitlab-runner in any server (Ubuntu for example).

Shared runners are online runners registered in gitlab cloud and are available for the community, also is possible to transform a shared machine into specific.

The config file (compiled in yaml format) runs in order the tasks declared in the stages section.

Each stage has these attributes:
 - stage: Identifier to match with stages section.
 - scrips: List of commands to run.
 - artifacts: List of files to inherited to next stages.
 - tags: List of runners or environments to run.
 - when: List of conditions (error, always, manual) to run commands.

A combination of tags, stages and when is possible to build a Integration/Deliver task in parallel, on demand and under specific conditions (pass test stages for example).






Comentarios