Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016-2017 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.

View File

@@ -0,0 +1,100 @@
# 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:
- [AWS CodeBuild](https://aws.amazon.com/codebuild/)
- [AppVeyor](http://www.appveyor.com)
- [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian
- [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines)
- [Buildkite](https://buildkite.com)
- [CircleCI](http://circleci.com)
- [Codeship](https://codeship.com)
- [Drone](https://drone.io)
- [GitLab CI](https://about.gitlab.com/gitlab-ci/)
- [GoCD](https://www.go.cd/)
- [Hudson](http://hudson-ci.org)
- [Jenkins CI](https://jenkins-ci.org)
- [Magnum CI](https://magnum-ci.com)
- [Semaphore](https://semaphoreci.com)
- [TaskCluster](http://docs.taskcluster.net)
- [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) by Microsoft
- [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains
- [Travis CI](http://travis-ci.org)
## 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.APPVEYOR`
- `ci.BAMBOO`
- `ci.BITBUCKET`
- `ci.BUILDKITE`
- `ci.CIRCLE`
- `ci.CODEBUILD`
- `ci.CODESHIP`
- `ci.DRONE`
- `ci.GITLAB`
- `ci.GOCD`
- `ci.HUDSON`
- `ci.JENKINS`
- `ci.MAGNUM`
- `ci.SEMAPHORE`
- `ci.TASKCLUSTER`
- `ci.TEAMCITY`
- `ci.TFS` (Team Foundation Server)
- `ci.TRAVIS`
## License
MIT

View File

@@ -0,0 +1,48 @@
'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'],
['CODEBUILD', 'AWS CodeBuild', 'CODEBUILD_BUILD_ARN']
]
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
)

View File

@@ -0,0 +1,67 @@
{
"_args": [
[
"ci-info@1.1.1",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "ci-info@1.1.1",
"_id": "ci-info@1.1.1",
"_inBundle": false,
"_integrity": "sha512-vHDDF/bP9RYpTWtUhpJRhCFdvvp3iDWvEbuDbWgvjUrNGV1MXJrE0MPcwGtEled04m61iwdBLUIHZtDgzWS4ZQ==",
"_location": "/react-scripts/ci-info",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "ci-info@1.1.1",
"name": "ci-info",
"escapedName": "ci-info",
"rawSpec": "1.1.1",
"saveSpec": null,
"fetchSpec": "1.1.1"
},
"_requiredBy": [
"/react-scripts/is-ci"
],
"_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.1.tgz",
"_spec": "1.1.1",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Thomas Watson Steen",
"email": "w@tson.dk",
"url": "https://twitter.com/wa7son"
},
"bugs": {
"url": "https://github.com/watson/ci-info/issues"
},
"coordinates": [
55.6773705,
12.5614183
],
"dependencies": {},
"description": "Get details about the current Continuous Integration environment",
"devDependencies": {
"clear-require": "^1.0.1",
"standard": "^10.0.3"
},
"homepage": "https://github.com/watson/ci-info",
"keywords": [
"ci",
"continuous",
"integration",
"test",
"detect"
],
"license": "MIT",
"main": "index.js",
"name": "ci-info",
"repository": {
"type": "git",
"url": "git+https://github.com/watson/ci-info.git"
},
"scripts": {
"test": "standard && node test.js"
},
"version": "1.1.1"
}