Skip to content

Commit

Permalink
feat: add Cirrus CI detection (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov authored and watson committed Aug 20, 2018
1 parent d3df574 commit 89344b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Officially supported CI servers:
- [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines)
- [Buildkite](https://buildkite.com)
- [CircleCI](http://circleci.com)
- [Cirrus CI](https://cirrus-ci.org)
- [Codeship](https://codeship.com)
- [Drone](https://drone.io)
- [GitLab CI](https://about.gitlab.com/gitlab-ci/)
Expand Down Expand Up @@ -86,6 +87,7 @@ Otherwise `false`.
- `ci.BITBUCKET`
- `ci.BUILDKITE`
- `ci.CIRCLE`
- `ci.CIRRUS`
- `ci.CODEBUILD`
- `ci.CODESHIP`
- `ci.DRONE`
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var vendors = [
['BITBUCKET', 'Bitbucket Pipelines', 'BITBUCKET_COMMIT'],
['BUILDKITE', 'Buildkite', 'BUILDKITE'],
['CIRCLE', 'CircleCI', 'CIRCLECI'],
['CIRRUS', 'Cirrus CI', 'CIRRUS_CI'],
['CODEBUILD', 'AWS CodeBuild', 'CODEBUILD_BUILD_ARN'],
['CODESHIP', 'Codeship', {CI_NAME: 'codeship'}],
['DRONE', 'Drone', 'DRONE'],
Expand Down Expand Up @@ -44,8 +45,8 @@ vendors.forEach(function (vendor) {
})

exports.isCI = !!(
env.CI || // Travis CI, CircleCI, Gitlab CI, Appveyor, CodeShip
env.CONTINUOUS_INTEGRATION || // Travis CI
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
env.BUILD_NUMBER || // Jenkins, TeamCity
exports.name ||
false
Expand Down
3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ assert.equal(ci.BAMBOO, false)
assert.equal(ci.BITBUCKET, false)
assert.equal(ci.BUILDKITE, false)
assert.equal(ci.CIRCLE, false)
assert.equal(ci.CIRRUS, false)
assert.equal(ci.CODEBUILD, false)
assert.equal(ci.CODESHIP, false)
assert.equal(ci.DRONE, false)
Expand Down Expand Up @@ -50,6 +51,7 @@ assert.equal(ci.BAMBOO, false)
assert.equal(ci.BITBUCKET, false)
assert.equal(ci.BUILDKITE, false)
assert.equal(ci.CIRCLE, false)
assert.equal(ci.CIRRUS, false)
assert.equal(ci.CODEBUILD, false)
assert.equal(ci.CODESHIP, false)
assert.equal(ci.DRONE, false)
Expand Down Expand Up @@ -81,6 +83,7 @@ assert.equal(ci.BAMBOO, false)
assert.equal(ci.BITBUCKET, false)
assert.equal(ci.BUILDKITE, false)
assert.equal(ci.CIRCLE, false)
assert.equal(ci.CIRRUS, false)
assert.equal(ci.CODEBUILD, false)
assert.equal(ci.CODESHIP, false)
assert.equal(ci.DRONE, false)
Expand Down

0 comments on commit 89344b6

Please sign in to comment.