Project: ci-info

Continuous Integration Information

Project Details

Latest version
0.3.0
Home Page
https://github.com/mgxd/ci-info
PyPI Page
https://pypi.org/project/ci-info/

Project Popularity

PageRank
0.0018172067696474886
Number of downloads
83816

ci-info

PyPI version Build Status

A Python implementation of watson/ci-info. Get details about the current Continuous Integration environment.

Please open an issue if your CI server isn't properly detected :)

Supported CI tools

Officially supported CI servers:

Name isPR
AWS CodeBuild 🚫
AppVeyor ✅
Azure Pipelines ✅
Appcircle 🚫
Bamboo by Atlassian 🚫
Bitbucket Pipelines ✅
Bitrise ✅
Buddy ✅
Buildkite ✅
CircleCI ✅
Cirrus CI ✅
Codefresh ✅
Codeship 🚫
Drone ✅
dsari 🚫
Expo Application Services 🚫
GitHub Actions ✅
GitLab CI ✅
GoCD 🚫
Hudson 🚫
Jenkins CI ✅
LayerCI ✅
Magnum CI 🚫
Netlify CI ✅
Nevercode ✅
Render ✅
Sail CI ✅
Screwdriver ✅
Semaphore ✅
Shippable ✅
Solano CI ✅
Strider CD 🚫
TaskCluster 🚫
TeamCity by JetBrains 🚫
Travis CI ✅
Vercel 🚫
Visual Studio App Center 🚫

Installation

pip install ci-info

Usage

import ci_info
if ci_info.is_ci():
    print(ci_info.name())

"My CI Name"

API

ci_info.name()

Returns a string containing name of the CI server the code is running on. If CI server is not detected, it returns None.

Don't depend on the value of this string not to change for a specific vendor.

ci_info.is_ci()

Returns a boolean. Will be True if the code is running on a CI server, otherwise False.

Some CI servers not listed here might still trigger the ci_info.is_ci() boolean to be set to True if they use certain vendor neutral environment variables. In those cases ci_info.name() will be None and no vendor specific boolean will be set to True.

ci_info.is_pr()

Returns a boolean if PR detection is supported for the current CI server. Will be True if a PR is being tested, otherwise False. If PR detection is not supported for the current CI server, the value will be None.

ci_info.info()

Returns a dictionary of all above values in key/value pairs.

License

MIT