diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/ci-info | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/ci-info')
-rw-r--r-- | node_modules/ci-info/.npmignore | 1 | ||||
-rw-r--r-- | node_modules/ci-info/.travis.yml | 7 | ||||
-rw-r--r-- | node_modules/ci-info/LICENSE | 21 | ||||
-rw-r--r-- | node_modules/ci-info/README.md | 98 | ||||
-rw-r--r-- | node_modules/ci-info/index.js | 47 | ||||
-rw-r--r-- | node_modules/ci-info/package.json | 35 | ||||
-rw-r--r-- | node_modules/ci-info/test.js | 81 |
7 files changed, 290 insertions, 0 deletions
diff --git a/node_modules/ci-info/.npmignore b/node_modules/ci-info/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/ci-info/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/ci-info/.travis.yml b/node_modules/ci-info/.travis.yml new file mode 100644 index 000000000..21f721050 --- /dev/null +++ b/node_modules/ci-info/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: +- '6' +- '5' +- '4' +- '0.12' +- '0.10' diff --git a/node_modules/ci-info/LICENSE b/node_modules/ci-info/LICENSE new file mode 100644 index 000000000..95f61daaa --- /dev/null +++ b/node_modules/ci-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Thomas Watson Steen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/ci-info/README.md b/node_modules/ci-info/README.md new file mode 100644 index 000000000..1208e7cf9 --- /dev/null +++ b/node_modules/ci-info/README.md @@ -0,0 +1,98 @@ +# ci-info + +Get details about the current Continuous Integration environment. + +Please [open an issue](https://github.com/watson/ci-info/issues) if your +CI server isn't properly detected :) + +[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) + +## Installation + +``` +npm install ci-info --save +``` + +## Usage + +```js +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](http://travis-ci.org) +- [CircleCI](http://circleci.com) +- [Jenkins CI](https://jenkins-ci.org) +- [Hudson](http://hudson-ci.org) +- [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian +- [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains +- [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) by Microsoft +- [GitLab CI](https://about.gitlab.com/gitlab-ci/) +- [Codeship](https://codeship.com) +- [Drone](https://drone.io) +- [Magnum CI](https://magnum-ci.com) +- [Semaphore](https://semaphoreci.com) +- [AppVeyor](http://www.appveyor.com) +- [Buildkite](https://buildkite.com) +- [TaskCluster](http://docs.taskcluster.net) +- [GoCD](https://www.go.cd/) +- [Bitbucket Pipelines](https://bitbucket.org/product/features/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.TRAVIS` +- `ci.CIRCLE` +- `ci.GITLAB` +- `ci.APPVEYOR` +- `ci.CODESHIP` +- `ci.DRONE` +- `ci.MAGNUM` +- `ci.SEMAPHORE` +- `ci.JENKINS` +- `ci.BAMBOO` +- `ci.TFS` (Team Foundation Server) +- `ci.TEAMCITY` +- `ci.BUILDKITE` +- `ci.HUDSON` +- `ci.TASKCLUSTER` +- `ci.GOCD` +- `ci.BITBUCKET` + +## License + +MIT diff --git a/node_modules/ci-info/index.js b/node_modules/ci-info/index.js new file mode 100644 index 000000000..e19925503 --- /dev/null +++ b/node_modules/ci-info/index.js @@ -0,0 +1,47 @@ +'use strict' + +var env = process.env + +var vendors = [ + // Constant, Name, Envs + ['TRAVIS', 'Travis CI', 'TRAVIS'], + ['CIRCLE', 'CircleCI', 'CIRCLECI'], + ['GITLAB', 'GitLab CI', 'GITLAB_CI'], + ['APPVEYOR', 'AppVeyor', 'APPVEYOR'], + ['CODESHIP', 'Codeship', {CI_NAME: 'codeship'}], + ['DRONE', 'Drone', 'DRONE'], + ['MAGNUM', 'Magnum CI', 'MAGNUM'], + ['SEMAPHORE', 'Semaphore', 'SEMAPHORE'], + ['JENKINS', 'Jenkins', 'JENKINS_URL'], + ['BAMBOO', 'Bamboo', 'bamboo_planKey'], + ['TFS', 'Team Foundation Server', 'TF_BUILD'], + ['TEAMCITY', 'TeamCity', 'TEAMCITY_VERSION'], + ['BUILDKITE', 'Buildkite', 'BUILDKITE'], + ['HUDSON', 'Hudsun', 'HUDSON_URL'], + ['TASKCLUSTER', 'TaskCluster', 'TASK_ID', 'RUN_ID'], + ['GOCD', 'GoCD', 'GO_PIPELINE_LABEL'], + ['BITBUCKET', 'Bitbucket Pipelines', 'BITBUCKET_COMMIT'] +] + +exports.name = null + +vendors.forEach(function (vendor) { + var constant = vendor.shift() + var name = vendor.shift() + var isCI = vendor.every(function (obj) { + if (typeof obj === 'string') return !!env[obj] + return Object.keys(obj).every(function (k) { + return env[k] === obj[k] + }) + }) + exports[constant] = isCI + if (isCI) exports.name = name +}) + +exports.isCI = !!( + env.CI || // Travis CI, CircleCI, Gitlab CI, Appveyor, CodeShip + env.CONTINUOUS_INTEGRATION || // Travis CI + env.BUILD_NUMBER || // Jenkins, TeamCity + exports.name || + false +) diff --git a/node_modules/ci-info/package.json b/node_modules/ci-info/package.json new file mode 100644 index 000000000..455287ccc --- /dev/null +++ b/node_modules/ci-info/package.json @@ -0,0 +1,35 @@ +{ + "name": "ci-info", + "version": "1.0.0", + "description": "Get details about the current Continuous Integration environment", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "clear-require": "^1.0.1", + "standard": "^8.4.0" + }, + "scripts": { + "test": "standard && node test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/watson/ci-info.git" + }, + "keywords": [ + "ci", + "continuous", + "integration", + "test", + "detect" + ], + "author": "Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)", + "license": "MIT", + "bugs": { + "url": "https://github.com/watson/ci-info/issues" + }, + "homepage": "https://github.com/watson/ci-info", + "coordinates": [ + 55.68768499999999, + 12.5955698 + ] +} diff --git a/node_modules/ci-info/test.js b/node_modules/ci-info/test.js new file mode 100644 index 000000000..e9c3101af --- /dev/null +++ b/node_modules/ci-info/test.js @@ -0,0 +1,81 @@ +'use strict' + +var assert = require('assert') +var clearRequire = require('clear-require') + +// Known CI +process.env.TRAVIS = 'true' +var ci = require('./') + +assert.equal(ci.isCI, true) +assert.equal(ci.name, 'Travis CI') +assert.equal(ci.TRAVIS, true) +assert.equal(ci.CIRCLE, false) +assert.equal(ci.GITLAB, false) +assert.equal(ci.APPVEYOR, false) +assert.equal(ci.CODESHIP, false) +assert.equal(ci.DRONE, false) +assert.equal(ci.MAGNUM, false) +assert.equal(ci.SEMAPHORE, false) +assert.equal(ci.JENKINS, false) +assert.equal(ci.BAMBOO, false) +assert.equal(ci.TFS, false) +assert.equal(ci.TEAMCITY, false) +assert.equal(ci.BUILDKITE, false) +assert.equal(ci.HUDSON, false) +assert.equal(ci.TASKCLUSTER, false) +assert.equal(ci.GOCD, false) +assert.equal(ci.BITBUCKET, false) + +// Not CI +delete process.env.CI +delete process.env.CONTINUOUS_INTEGRATION +delete process.env.BUILD_NUMBER +delete process.env.TRAVIS +clearRequire('./') +ci = require('./') + +assert.equal(ci.isCI, false) +assert.equal(ci.name, undefined) +assert.equal(ci.TRAVIS, false) +assert.equal(ci.CIRCLE, false) +assert.equal(ci.GITLAB, false) +assert.equal(ci.APPVEYOR, false) +assert.equal(ci.CODESHIP, false) +assert.equal(ci.DRONE, false) +assert.equal(ci.MAGNUM, false) +assert.equal(ci.SEMAPHORE, false) +assert.equal(ci.JENKINS, false) +assert.equal(ci.BAMBOO, false) +assert.equal(ci.TFS, false) +assert.equal(ci.TEAMCITY, false) +assert.equal(ci.BUILDKITE, false) +assert.equal(ci.HUDSON, false) +assert.equal(ci.TASKCLUSTER, false) +assert.equal(ci.GOCD, false) +assert.equal(ci.BITBUCKET, false) + +// Unknown CI +process.env.CI = 'true' +clearRequire('./') +ci = require('./') + +assert.equal(ci.isCI, true) +assert.equal(ci.name, undefined) +assert.equal(ci.TRAVIS, false) +assert.equal(ci.CIRCLE, false) +assert.equal(ci.GITLAB, false) +assert.equal(ci.APPVEYOR, false) +assert.equal(ci.CODESHIP, false) +assert.equal(ci.DRONE, false) +assert.equal(ci.MAGNUM, false) +assert.equal(ci.SEMAPHORE, false) +assert.equal(ci.JENKINS, false) +assert.equal(ci.BAMBOO, false) +assert.equal(ci.TFS, false) +assert.equal(ci.TEAMCITY, false) +assert.equal(ci.BUILDKITE, false) +assert.equal(ci.HUDSON, false) +assert.equal(ci.TASKCLUSTER, false) +assert.equal(ci.GOCD, false) +assert.equal(ci.BITBUCKET, false) |