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

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

Name

ID

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 Actions runner

github_ci

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()

Unknown CI

unknown_ci

is_unknown_ci()

Groups of CI

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

        ---
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
ALL_CI,unknown_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)
        (♲ unknown_ci)
    

extra_platforms.ci API

        classDiagram
  Trait <|-- CI
    

CI/CD environments.

class extra_platforms.ci.CI(id, name, icon='♲', url='')[source]

Bases: Trait

A CI/CD environment identifies a continuous integration platform.

It has a unique ID, a human-readable name, and boolean to flag current CI.

icon: str = '♲'

Icon of the CI environment.

info()[source]

Returns all CI attributes we can gather.

Return type:

dict[str, str | bool | None]

extra_platforms.ci_data API

CI definitions and metadata.