• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..23-May-2020-

CHANGELOG.mdH A D26-Oct-19852 KiB7947

LICENSEH A D26-Oct-19851.1 KiB2217

README.mdH A D26-Oct-19854 KiB10981

package.jsonH A D23-May-20201.6 KiB6665

vendors.jsonH A D26-Oct-19853 KiB154153

README.md

1# ci-info
2
3Get details about the current Continuous Integration environment.
4
5Please [open an
6issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md)
7if your CI server isn't properly detected :)
8
9[![npm](https://img.shields.io/npm/v/ci-info.svg)](https://www.npmjs.com/package/ci-info)
10[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info)
11[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
12
13## Installation
14
15```bash
16npm install ci-info --save
17```
18
19## Usage
20
21```js
22var ci = require('ci-info')
23
24if (ci.isCI) {
25  console.log('The name of the CI server is:', ci.name)
26} else {
27  console.log('This program is not running on a CI server')
28}
29```
30
31## Supported CI tools
32
33Officially supported CI servers:
34
35| Name | Constant | isPR |
36|------|----------|------|
37| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | �� |
38| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | ✅ |
39| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | `ci.AZURE_PIPELINES` | ✅ |
40| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | �� |
41| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | ✅ |
42| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | ✅ |
43| [Buddy](https://buddy.works/) | `ci.BUDDY` | ✅ |
44| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | ✅ |
45| [CircleCI](http://circleci.com) | `ci.CIRCLE` | ✅ |
46| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | ✅ |
47| [Codeship](https://codeship.com) | `ci.CODESHIP` | �� |
48| [Drone](https://drone.io) | `ci.DRONE` | ✅ |
49| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | �� |
50| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | �� |
51| [GoCD](https://www.go.cd/) | `ci.GOCD` | �� |
52| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | �� |
53| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | ✅ |
54| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | �� |
55| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ |
56| [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ |
57| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | ✅ |
58| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | ✅ |
59| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | ✅ |
60| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | �� |
61| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | �� |
62| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | �� |
63| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | ✅ |
64
65## API
66
67### `ci.name`
68
69Returns a string containing name of the CI server the code is running on.
70If CI server is not detected, it returns `null`.
71
72Don't depend on the value of this string not to change for a specific
73vendor. If you find your self writing `ci.name === 'Travis CI'`, you
74most likely want to use `ci.TRAVIS` instead.
75
76### `ci.isCI`
77
78Returns a boolean. Will be `true` if the code is running on a CI server,
79otherwise `false`.
80
81Some CI servers not listed here might still trigger the `ci.isCI`
82boolean to be set to `true` if they use certain vendor neutral
83environment variables. In those cases `ci.name` will be `null` and no
84vendor specific boolean will be set to `true`.
85
86### `ci.isPR`
87
88Returns a boolean if PR detection is supported for the current CI server. Will
89be `true` if a PR is being tested, otherwise `false`. If PR detection is
90not supported for the current CI server, the value will be `null`.
91
92### `ci.<VENDOR-CONSTANT>`
93
94A vendor specific boolean constant is exposed for each support CI
95vendor. A constant will be `true` if the code is determined to run on
96the given CI server, otherwise `false`.
97
98Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a
99complete list, see the support table above.
100
101Deprecated vendor constants that will be removed in the next major
102release:
103
104- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO`
105
106## License
107
108[MIT](LICENSE)
109