CI systems

Each CI system represents a continuous integration/delivery platform, and is associated with:

  • a unique CI ID

  • a human-readable name

  • an icon (emoji / unicode character)

  • a detection function

  • various metadata in its info() method

CI usage

Each CI system is materialized by a CI object, from which you can access various metadata:

>>> from extra_platforms import GITHUB_CI
>>> GITHUB_CI
CI(id='github_ci', name='GitHub Actions runner')
>>> GITHUB_CI.id
'github_ci'
>>> GITHUB_CI.current
False
>>> GITHUB_CI.info()
{'id': 'github_ci', 'name': 'GitHub Actions runner', 'icon': '🐙', 'url': 'https://docs.github.com/en/actions', 'current': False}

To check if the current environment is running in a specific CI system, use the corresponding detection function:

>>> from extra_platforms import is_github_ci
>>> is_github_ci()
False

The current CI system can be obtained via the current_ci() function:

>>> from extra_platforms import current_ci
>>> current_ci()
CI(id='unknown_ci', name='Unknown CI')

Recognized CI

Icon

Symbol

Name

Detection function

AZURE_PIPELINES

Azure Pipelines

is_azure_pipelines()

BAMBOO

Bamboo

is_bamboo()

🪁

BUILDKITE

Buildkite

is_buildkite()

CIRCLE_CI

Circle CI

is_circle_ci()

CIRRUS_CI

Cirrus CI

is_cirrus_ci()

CODEBUILD

CodeBuild

is_codebuild()

🐙

GITHUB_CI

GitHub Actions runner

is_github_ci()

🦊

GITLAB_CI

GitLab CI

is_gitlab_ci()

HEROKU_CI

Heroku CI

is_heroku_ci()

🏙️

TEAMCITY

TeamCity

is_teamcity()

👷

TRAVIS_CI

Travis CI

is_travis_ci()

Hint

The UNKNOWN_CI trait represents an unrecognized CI system. It is not included in the ALL_CI group, and will be returned by current_ci() if the current CI system is not recognized.

Groups of CI

There is only one group defined for CI systems: ALL_CI, which includes all recognized CI systems.

Icon

Symbol

Description

Detection

Canonical

ALL_CI

CI systems

is_any_ci()

        ---
config:
  sankey:
    height: 800
    showValues: false
    width: 800

---
sankey-beta

ALL_CI,AZURE_PIPELINES,1
ALL_CI,BAMBOO,1
ALL_CI,BUILDKITE,1
ALL_CI,CIRCLE_CI,1
ALL_CI,CIRRUS_CI,1
ALL_CI,CODEBUILD,1
ALL_CI,GITHUB_CI,1
ALL_CI,GITLAB_CI,1
ALL_CI,HEROKU_CI,1
ALL_CI,TEAMCITY,1
ALL_CI,TRAVIS_CI,1
    
        ---
config:
  mindmap:
    padding: 5

---
mindmap
    ((♺ ALL_CI))
        (═ AZURE_PIPELINES)
        (⟲ BAMBOO)
        (🪁 BUILDKITE)
        (⪾ CIRCLE_CI)
        (≋ CIRRUS_CI)
        (ᚙ CODEBUILD)
        (🐙 GITHUB_CI)
        (🦊 GITLAB_CI)
        (⥁ HEROKU_CI)
        (🏙️ TEAMCITY)
        (👷 TRAVIS_CI)
    

Predefined CI

CI definitions and metadata.

extra_platforms.AZURE_PIPELINES = CI(id='azure_pipelines', name='Azure Pipelines')

Identify Azure Pipelines environment.

extra_platforms.BAMBOO = CI(id='bamboo', name='Bamboo')

Identify Bamboo environment.

extra_platforms.BUILDKITE = CI(id='buildkite', name='Buildkite')

Identify Buildkite environment.

extra_platforms.CIRCLE_CI = CI(id='circle_ci', name='Circle CI')

Identify Circle CI environment.

extra_platforms.CIRRUS_CI = CI(id='cirrus_ci', name='Cirrus CI')

Identify Cirrus CI environment.

extra_platforms.CODEBUILD = CI(id='codebuild', name='CodeBuild')

Identify CodeBuild environment.

extra_platforms.GITHUB_CI = CI(id='github_ci', name='GitHub Actions runner')

Identify GitHub Actions runner environment.

extra_platforms.GITLAB_CI = CI(id='gitlab_ci', name='GitLab CI')

Identify GitLab CI environment.

extra_platforms.HEROKU_CI = CI(id='heroku_ci', name='Heroku CI')

Identify Heroku CI environment.

extra_platforms.TEAMCITY = CI(id='teamcity', name='TeamCity')

Identify TeamCity environment.

extra_platforms.TRAVIS_CI = CI(id='travis_ci', name='Travis CI')

Identify Travis CI environment.

extra_platforms.UNKNOWN_CI = CI(id='unknown_ci', name='Unknown CI')

Identify Unknown CI environment.