Continuous Integration Information
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 :)
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 | 🚫 |
pip install ci-info
import ci_info
if ci_info.is_ci():
print(ci_info.name())
"My CI Name"
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.