prometa.git.gitlab.ci package

Subpackages

Submodules

prometa.git.gitlab.ci.ci_job_manager module

Base class for each CI job manager.

class prometa.git.gitlab.ci.ci_job_manager.CIJobManager(gitlab_ci)[source]

Bases: Registrable

Registrable base class for each CI job manager.

NAME = None[source]
__init__(gitlab_ci)[source]
Parameters:

gitlab_ci – A GitLabCI instance.

property enabled[source]

The job’s name is in the gitlab.enabled_ci_jobs list in the configuration file.

manage()[source]

Manage the job in the CI file according to current project conditions and configuration settings.

prometa.git.gitlab.ci.pages module

Manage the pages job.

class prometa.git.gitlab.ci.pages.PagesCIJobManager(gitlab_ci)[source]

Bases: CIJobManager

This does not create the pages job. It only updates it to set the following fields: “artifacts”, “only” and “stage”.

NAME = 'pages'[source]
manage()[source]

Manage the job in the CI file according to current project conditions and configuration settings.

prometa.git.gitlab.ci.release_job module

Manage the release_job job.

class prometa.git.gitlab.ci.release_job.ReleaseJobCIJobManager(gitlab_ci)[source]

Bases: CIJobManager

Add a release job that triggers when Git release tags are pushed. The release tag regular expression can be set in the configuration file.

NAME = 'release_job'[source]
manage()[source]

Manage the job in the CI file according to current project conditions and configuration settings.

Module contents

Manage the CI file.

class prometa.git.gitlab.ci.CIJobManager(gitlab_ci)[source]

Bases: Registrable

Registrable base class for each CI job manager.

NAME = None[source]
__init__(gitlab_ci)[source]
Parameters:

gitlab_ci – A GitLabCI instance.

property enabled[source]

The job’s name is in the gitlab.enabled_ci_jobs list in the configuration file.

manage()[source]

Manage the job in the CI file according to current project conditions and configuration settings.

class prometa.git.gitlab.ci.GitLabCI(host, path='.gitlab-ci.yml')[source]

Bases: object

Wrapper around the gitlab-ci file.

__init__(host, path='.gitlab-ci.yml')[source]
Parameters:
  • host – A GitLabHost instance.

  • path – The path to the gitlab-ci file, relative to the repository root directory.

add_stages()[source]

Add the list of stages for all added jobs.

add_tags()[source]

Add runner tags. This will deduplicate tags and also ensure that jobs using the same tags reference each other in the YAML output.

property data[source]

The CI configuration data.

get_ci_job_manager(name)[source]

Get an instance of the named CIJobManager subclass.

load()[source]

Load the file data.

Returns:

The loaded data, or an empty dict if the file does not exist.

manage()[source]

Manage the configured jobs in the CI file.

property project[source]

The Project instance or subclass.