## page was copied from Quality/Tutorials/Continuous integration with private repositories
## For instruction on writing tutorials
## http://www.ros.org/wiki/WritingTutorials
####################################
##FILL ME IN
####################################
## for a custom note with links:
## note =
## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links 
## note.0= 
## descriptive title for the tutorial
## title = Continuous integration with private repositories
## multi-line description to be displayed in search 
## description = In this tutorial you will learn how to make use of continuous integration for private repositories.
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.0.link=
## next.1.link=
## what level user is this tutorial for 
## level= (BeginnerCategory, IntermediateCategory, AdvancedCategory)
## keywords =
####################################

<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(4)>>

== Context ==
An application developer wants to use a continuous integration service as part of his/her development process in order to parallel to the development check that the application can be integrated and deployed and allow for regression tests. The CI shall be run in a separate server, and run automatically builds and tests defined in the code.

== Problem ==
There are several options available to use CI, as Travis or the ROS buildfarm. However Travis does not support privately hosted repositories (only GitHub at the moment), and setting up and running a private installation of buildfarm is overcomplicated.

== Forces ==
=== Producing Quality Code ===
Developing quality code is a process that can be facilitated by the use of the appropriate tools. CI is one of such tools, and a cornerstone in quality assurance procedures, providing automated ways of ensuring reproducibility, regressions tests, deployability and so on.

=== Make ROS business friendly ===
The use of ROS and ROS-I should be extended beyond the academic community, into industrial applications and industrial actors using and contributing to it. These actors usually have stricter IP sharing rules, and by giving them the proper tools such as CI, we facilitate their involvement into the ROS community.

=== Facilitate the collaboration and contribution to the community ===
Code contributed to the ROS repository is expected to comply with certain rules regarding its quality. By the use of CI as part of the development process, compliance with such requirements is facilitated, which fosters further contributions.

== Solution ==
We provide instructions here on how to set up a system/process based on the use of Jenkins + industrial_ci + GitLab. The rationale to choose such a combination, instead of other available alternatives such as buildfarm, Travis and others is:

 * support for private repositories and in-house installation
 * based on open-source tools
 * easy installation and setup time
 * low threshold for usage, easy integration of new components into the process
 * extensible
 * GitLab is a well-known repository manager; however the instructions can be easily adapted and applied to other infrastructures


=== Components of the solution ===
==== Jenkins ====

Jenkins is an open-source automation server written in Java, that runs in servlet containers such as Apache Tomcat. It is mainly targeting facilitating the automation of continuous integration aspects: it offers integration with many version control tools, such as CVS, Subversion, Git, or Mercurial (can be extended to others through the use of plugins), and offers different ways of triggering builds, such as commits in the control version system or scheduling with a cron-like mechanism.

It also provides web-based reporting capabilities for the results of the builds (interface with the user is mainly web-based).

Jenkins supports scalability through a "master/slave" mode, where the workload of building projects are delegated to multiple "slave" nodes, allowing a single Jenkins installation to host a large number of projects, or to provide different environments needed for builds/tests.

Jenkins' functionality can also be extended by the addition of plugins.

==== industrial_ci ====

industrial_ci is a set of bash scripts that can be used to check that a ROS package builds and installs without issues. If unit or system tests are defined, it can also run them. In order to ensure reproducibility, the builds are run in empty Docker containers, in which the dependencies specified are installed.

== Stakeholders ==

Installer / !SysAdmin

Link to Jenkins and industrial_ci: Quick manual; Section For installer / administration


== Links ==
 * industrial_ci: [[http://wiki.ros.org/industrial_ci|ROS Wiki]]; [[https://github.com/ros-industrial/industrial_ci|GitHub repository]]
 * [[https://github.com/ros-industrial/industrial_ci/blob/master/doc/index.rst|industrial_ci documentation]]
 * [[https://jenkins.io/|Jenkins]]
 * [[https://plugins.jenkins.io/|Jenkins plugins]]
 * [[http://wiki.ros.org/ROS/Tutorials/rosdep|rosdep]]
 * [[http://www.ros.org/reps/rep-0126.html|REP 126]]
 * [[http://docs.ros.org/independent/api/rosinstall/html/rosinstall_file_format.html|rosinstall file format]]
 * The ROS build farm - what it can do for me [[https://roscon.ros.org/2016/presentations/ROSCon2016%20Build%20Farm.pdf|pdf]]; [[https://vimeo.com/187705230|video]]
 * buildfarm [[http://wiki.ros.org/buildfarm|web]] / [[https://github.com/ros2/ros_buildfarm_config|ros_buildfarm2]]
 * [[http://wiki.ros.org/CIs|ROS and CI]]
 * [[http://wiki.ros.org/UnitTesting|ROS Unit Testing]]

== Related patterns ==
 * Integrating tests in the build
 * MIL testing
 * Best Practices
 * Regression Testing
 * Pre-release testing


## AUTOGENERATED DO NOT DELETE 
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE