Package Exports
- ci-info
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ci-info) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ci-info
Get details about the current Continuous Integration environment.
Please open an issue if your CI server isn't properly detected :)
Installation
npm install ci-info --saveUsage
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')
}Supported CI tools
Officially supported CI servers:
- Travis CI
- CircleCI
- Jenkins CI
- Hudson
- Bamboo by Atlassian
- TeamCity by JetBrains
- Team Foundation Server by Microsoft
- GitLab CI
- Codeship
- Drone
- Magnum CI
- Semaphore
- AppVeyor
- Buildkite
- TaskCluster
- GoCD
- Bitbucket Pipelines
API
ci.name
A string. Will contain the name of the CI server the code is running on.
If not CI server is detected, it will be 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
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.<VENDOR-CONSTANT>
The following vendor specific boolean constants are exposed. A constant
will be true if the code is determined to run on the given CI server.
Otherwise false.
ci.TRAVISci.CIRCLEci.GITLABci.APPVEYORci.CODESHIPci.DRONEci.MAGNUMci.SEMAPHOREci.JENKINSci.BAMBOOci.TFS(Team Foundation Server)ci.TEAMCITYci.BUILDKITEci.HUDSONci.TASKCLUSTERci.GOCDci.BITBUCKET
License
MIT