source: node_modules/ci-info/README.md

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 7.8 KB
Line 
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[![Tests](https://github.com/watson/ci-info/workflows/Tests/badge.svg)](https://github.com/watson/ci-info/actions)
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| [Appcircle](https://appcircle.io/) | `ci.APPCIRCLE` | 🚫 |
41| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | 🚫 |
42| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | ✅ |
43| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | ✅ |
44| [Buddy](https://buddy.works/) | `ci.BUDDY` | ✅ |
45| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | ✅ |
46| [CircleCI](http://circleci.com) | `ci.CIRCLE` | ✅ |
47| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | ✅ |
48| [Codefresh](https://codefresh.io/) | `ci.CODEFRESH` | ✅ |
49| [Codeship](https://codeship.com) | `ci.CODESHIP` | 🚫 |
50| [Drone](https://drone.io) | `ci.DRONE` | ✅ |
51| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | 🚫 |
52| [Expo Application Services](https://expo.dev/eas) | `ci.EAS` | 🚫 |
53| [Gerrit CI](https://www.gerritcodereview.com) | `ci.GERRIT` | 🚫 |
54| [GitHub Actions](https://github.com/features/actions/) | `ci.GITHUB_ACTIONS` | ✅ |
55| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | ✅ |
56| [GoCD](https://www.go.cd/) | `ci.GOCD` | 🚫 |
57| [Google Cloud Build](https://cloud.google.com/build) | `ci.GOOGLE_CLOUD_BUILD` | 🚫 |
58| [Harness CI](https://www.harness.io/products/continuous-integration) | `ci.HARNESS` | 🚫 |
59| [Heroku](https://www.heroku.com) | `ci.HEROKU` | 🚫 |
60| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | 🚫 |
61| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | ✅ |
62| [LayerCI](https://layerci.com/) | `ci.LAYERCI` | ✅ |
63| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 |
64| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ |
65| [Nevercode](http://nevercode.io/) | `ci.NEVERCODE` | ✅ |
66| [ReleaseHub](https://releasehub.com/) | `ci.RELEASEHUB` | 🚫 |
67| [Render](https://render.com/) | `ci.RENDER` | ✅ |
68| [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ |
69| [Screwdriver](https://screwdriver.cd/) | `ci.SCREWDRIVER` | ✅ |
70| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | ✅ |
71| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | ✅ |
72| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | ✅ |
73| [Sourcehut](https://sourcehut.org/) | `ci.SOURCEHUT` | 🚫 |
74| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | 🚫 |
75| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 |
76| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 |
77| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | ✅ |
78| [Vercel](https://vercel.com/) | `ci.VERCEL` | ✅ |
79| [Visual Studio App Center](https://appcenter.ms/) | `ci.APPCENTER` | 🚫 |
80| [Woodpecker](https://woodpecker-ci.org/) | `ci.WOODPECKER` | ✅ |
81
82## API
83
84### `ci.name`
85
86Returns a string containing name of the CI server the code is running on.
87If CI server is not detected, it returns `null`.
88
89Don't depend on the value of this string not to change for a specific
90vendor. If you find your self writing `ci.name === 'Travis CI'`, you
91most likely want to use `ci.TRAVIS` instead.
92
93### `ci.isCI`
94
95Returns a boolean. Will be `true` if the code is running on a CI server,
96otherwise `false`.
97
98Some CI servers not listed here might still trigger the `ci.isCI`
99boolean to be set to `true` if they use certain vendor neutral
100environment variables. In those cases `ci.name` will be `null` and no
101vendor specific boolean will be set to `true`.
102
103### `ci.isPR`
104
105Returns a boolean if PR detection is supported for the current CI server. Will
106be `true` if a PR is being tested, otherwise `false`. If PR detection is
107not supported for the current CI server, the value will be `null`.
108
109### `ci.<VENDOR-CONSTANT>`
110
111A vendor specific boolean constant is exposed for each support CI
112vendor. A constant will be `true` if the code is determined to run on
113the given CI server, otherwise `false`.
114
115Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a
116complete list, see the support table above.
117
118Deprecated vendor constants that will be removed in the next major
119release:
120
121- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO`
122
123## Ports
124
125ci-info has been ported to the following languages
126
127| Language | Repository |
128|----------|------------|
129| Go | https://github.com/hofstadter-io/cinful |
130| Rust | https://github.com/sagiegurari/ci_info |
131| Kotlin | https://github.com/cloudflightio/ci-info |
132
133## License
134
135[MIT](LICENSE)
Note: See TracBrowser for help on using the repository browser.