Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

GitLabCI

milenk edited this page Mar 18, 2019 · 6 revisions

To use GitLab as a metric source for CI server metrics, create a GitLab instance and add it to the project:

GITLAB = metric_source.GitLabCI("http://gitlab.com/", "my.namespace/my-project", private_token="ab12...")
PROJECT = Project(
    ...
    metric_sources={metric_source.CIServer: GITLAB})

The of private_token is a Personal Access Token, created in GitLab, according to this link.

By providing a list of project names, the jobs of all the projects will be considered together:

GITLAB = metric_source.GitLabCI("http://gitlab.com/", "Proj_1", "Proj_2", private_token="ab1...")

At the end, it is possible to filter the set of jobs that would come into the consideration, using regular expressions. For example:

GITLAB = metric_source.GitLabCI("http://gitlab.com/", "Proj_1", branch_re='\S*_\d',  private_token="ab123...")

will consider 'Job_1' and not 'Job42'.

Clone this wiki locally