<commit_before># industrial_ci
Continuous integration repository for ROS-Industrial

.. contents:: Table of Contents
   :depth: 3

Description
============

This repository contains `CI (Continuous Integration)<https://en.wikipedia.org/wiki/Continuous_integration>`_ configuration that can be commonly used by the repositories in `ros-industrial<https://github.com/ros-industrial>`_ organization (calling them as "**client**" repos). ROS-powered repositories in other organizations can potentially utilize the CI config here too.

(As of November 2015) The CI config in this repository is intended to be used by the client repos by `git submodule` feature. This repo provides configuration for `travis CI`. In client repos you can define the repository-specific checks, in addition to calling the config stored in this repo.

Usage
======

Here are some operations in your client repositories.

First time you define the dependency to this repo
--------------------------------------------------

 1. Run git submodule command.

 ::

  CLIENTREPO_LOCAL$ git submodule add https://github.com/ros-industrial/industrial_ci .ci_config

 This standard `git submodule` command hooks up your client repository to this repo by the name `.ci_config` (`.ci_config` is hardcoded so you should not change).

 2. Don't forget to activate CI on your github repository (you may do so on https://travis-ci.org/profile/YOUR_GITHUB_USER).

 3. In `.travis.yml` file in your client repo, add the portion below:

 ::

  script: 
    - source .ci_config/travis.sh
    #  - source ./travis.sh  # Optional. Explained later

That's it.

Apply the changes in this repo (industrial_ci) to the checking in client repos
----------------------------------------------------------------------------------

Maintainers of client repos are responsible for applying the changes in this repos, if they want to stay up-to-date.

 1. Update the SHA key of the commit in this repo. The command below assumes that there's `.gitmodules` file that's generated by `git submodule add` command explained above.

 ::

  CLIENTREPO_LOCAL$ git submodule foreach git pull origin master

 2. Don't forget to commit the changes the command above makes.

(Optional but recommended) Subscribe to the change in this repo (industrial_ci)
---------------------------------------------------------------------------------

Because of the maintainers' responsibility described above to keep the CI config client repos use up-to-date, `you're encouraged to subscribe to the updates in this repository<https://github.com/ros-industrial/industrial_ci/subscription>`_.

Add repository-specific CI config in addition
----------------------------------------------------------------

Sometimes CI config stored in `industrial_ci` repo may not be sufficient for your purpose. In that case you can add your own config, while you still take advantage of `industrial_ci` repository.

 1. In `.travis.yml` file in your client repo, add the portion below:

 ::

  script: 
    - source .ci_config/travis.sh
    - source ./travis.sh

 2. Create `travis.sh` file and define the checks you wish to add. NOTE: this `.sh` file you add here is a normal shell script, so this shouldn't be written in `travis CI` grammar.

For maintainers of industrial_ci repository
================================================

While this repository provides CI config that can be used by other repositories, it also checks this repo itself using the same CI config and the simplest package setting. That is why this repo contains the ROS package files and a test (`CMakeLists.txt`, `package.xml`, `.test`).
<commit_msg>readme improvement<commit_after># industrial_ci
Continuous integration repository for ROS-Industrial

.. contents:: Table of Contents
   :depth: 3

Description
============

This repository contains `CI (Continuous Integration) <https://en.wikipedia.org/wiki/Continuous_integration>`_ configuration that can be commonly used by the repositories in `ros-industrial <https://github.com/ros-industrial>`_ organization (calling them as "**client**" repos). ROS-powered repositories in other organizations can potentially utilize the CI config here too.

(As of November 2015) The CI config in this repository is intended to be used by the client repos by `git submodule` feature. This repo provides configuration for `travis CI`. In client repos you can define custom, repository-specific checks, in addition to the generic config stored in this repo.

What checks are enforced for the client repositories?
-------------------------------------------------------------

Some checked items:

* If your package builds.
* If your built package goes into the `install` space.
* If tests (if any) available pass the package. Because tests use software from `install` space, it is important the building step ends without issues (otherwise tests may not be reached).

Variables you can configure
++++++++++++++++++++++++++++++++++++

* OS to use. Defined at `dist` tag in `.travis.yml` in the client repo.
* Location of ROS' binary repositories where depended packages get installed from (typically both standard repo and `"Shadow-Fixed" repository <http://wiki.ros.org/ShadowRepository>`_): defined as `ROS_REPOSITORY_PATH` variable in client repo.
* Version of ROS (Indigo, Jade etc.). Defined as `ROS_DISTRO` variable in client repo.

Usage
======

Here are some operations in your client repositories.

First time you define the dependency to this repo
--------------------------------------------------

1. Run git submodule command.

::

  CLIENTREPO_LOCAL$ git submodule add https://github.com/ros-industrial/industrial_ci .ci_config

This standard `git submodule` command:

* hooks up your client repository to this repo by the name "`.ci_config`" (this name is hardcoded and mandatory).
* stores the configuration in a file called `.gitmodules`.

2. Don't forget to activate CI on your github repository (you may do so on https://travis-ci.org/profile/YOUR_GITHUB_USER).

3. In `.travis.yml` file in your client repo, add the portion below:

::

  script: 
    - source .ci_config/travis.sh
    #- source ./travis.sh  # Optional. Explained later

Also, the example of entire file `.travis.yml` can be found in `industrial_core/.travis.yml <https://github.com/ros-industrial/industrial_core/.travis.yml>`_.

That's it.

Apply the changes in this repo (industrial_ci) to the checking in client repos
----------------------------------------------------------------------------------

Maintainers of client repos are responsible for applying the changes that happen in this repos, if they want to use up-to-date checks; since `git submodule` does NOT provide features to automatically detect the changes made in the sub modules, maintainers need to keep an eye on the changes.

1. Update the SHA key of the commit in this repo. The command below assumes that there's `.gitmodules` file that's generated by `git submodule add` command explained above.

::

  CLIENTREPO_LOCAL$ git submodule foreach git pull origin master

2. Don't forget to commit the changes the command above makes.

(Optional but recommended) Subscribe to the change in this repo (industrial_ci)
---------------------------------------------------------------------------------

Because of the aforementioned responsibility for the maintainers to watch the changes in `industrial_ci`, `you're encouraged to subscribe to the updates in this repository <https://github.com/ros-industrial/industrial_ci/subscription>`_.

Add repository-specific CI config in addition
----------------------------------------------------------------

Sometimes CI config stored in `industrial_ci` repo may not be sufficient for your purpose. In that case you can add your own config, while you still take advantage of `industrial_ci` repository.

1. In `.travis.yml` file in your client repo, add the portion below:

::

  script: 
    - source .ci_config/travis.sh
    - source ./travis.sh

2. Create `travis.sh` file and define the checks you wish to add. NOTE: this `.sh` file you add here is a normal shell script, so this shouldn't be written in `travis CI` grammar.

For maintainers of industrial_ci repository
================================================

Checks for industrial_ci repo itself
---------------------------------------

While this repository provides CI config that can be used by other repositories, it also checks this repo itself using the same CI config and the simplest package setting. That is why this repo contains the ROS package files and a test (`CMakeLists.txt`, `package.xml`, `.test`).

{'fraction_non_alphanumeric': 0.1564570498663257, 'fraction_numerical': 0.002789724514704173, 'mean_word_length': 3.0413339596054487, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6011826', 'n_tokens_mistral': 2210, 'n_tokens_neox': 2028, 'n_words': 1053}