Philipp Partosch 46a936d7de added all files to project | 2 years ago | |
---|---|---|
.. | ||
CHANGELOG.md | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
index.d.ts | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago | |
vendors.json | 2 years ago |
Get details about the current Continuous Integration environment.
Please open an issue if your CI server isnβt properly detected :)
npm install ci-info --save
var ci = require('ci-info')
if (ci.isCI) {
console.log('The name of the CI server is:', ci.name)
} else {
console.log('This program is not running on a CI server')
}
Officially supported CI servers:
Name | Constant | isPR |
---|---|---|
AWS CodeBuild | ci.CODEBUILD |
π« |
AppVeyor | ci.APPVEYOR |
β |
Azure Pipelines | ci.AZURE_PIPELINES |
β |
Appcircle | ci.APPCIRCLE |
π« |
Bamboo by Atlassian | ci.BAMBOO |
π« |
Bitbucket Pipelines | ci.BITBUCKET |
β |
Bitrise | ci.BITRISE |
β |
Buddy | ci.BUDDY |
β |
Buildkite | ci.BUILDKITE |
β |
CircleCI | ci.CIRCLE |
β |
Cirrus CI | ci.CIRRUS |
β |
Codefresh | ci.CODEFRESH |
β |
Codeship | ci.CODESHIP |
π« |
Drone | ci.DRONE |
β |
dsari | ci.DSARI |
π« |
GitHub Actions | ci.GITHUB_ACTIONS |
β |
GitLab CI | ci.GITLAB |
β |
GoCD | ci.GOCD |
π« |
Hudson | ci.HUDSON |
π« |
Jenkins CI | ci.JENKINS |
β |
LayerCI | ci.LAYERCI |
β |
Magnum CI | ci.MAGNUM |
π« |
Netlify CI | ci.NETLIFY |
β |
Nevercode | ci.NEVERCODE |
β |
Render | ci.RENDER |
β |
Sail CI | ci.SAIL |
β |
Screwdriver | ci.SCREWDRIVER |
β |
Semaphore | ci.SEMAPHORE |
β |
Shippable | ci.SHIPPABLE |
β |
Solano CI | ci.SOLANO |
β |
Strider CD | ci.STRIDER |
π« |
TaskCluster | ci.TASKCLUSTER |
π« |
TeamCity by JetBrains | ci.TEAMCITY |
π« |
Travis CI | ci.TRAVIS |
β |
Vercel | ci.VERCEL |
π« |
Visual Studio App Center | ci.APPCENTER |
π« |
ci.name
Returns a string containing name of the CI server the code is running on.
If CI server is not detected, it returns null
.
Donβt depend on the value of this string not to change for a specific
vendor. If you find your self writing ci.name === 'Travis CI'
, you
most likely want to use ci.TRAVIS
instead.
ci.isCI
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.isCI
boolean to be set to true
if they use certain vendor neutral
environment variables. In those cases ci.name
will be null
and no
vendor specific boolean will be set to true
.
ci.isPR
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 null
.
ci.<VENDOR-CONSTANT>
A vendor specific boolean constant is exposed for each support CI
vendor. A constant will be true
if the code is determined to run on
the given CI server, otherwise false
.
Examples of vendor constants are ci.TRAVIS
or ci.APPVEYOR
. For a
complete list, see the support table above.
Deprecated vendor constants that will be removed in the next major release:
ci.TDDIUM
(Solano CI) This have been renamed ci.SOLANO