From b950b1a0d386647bedc85c9648a8b885df48ea11 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Mon, 1 Jan 2018 21:33:48 -0500 Subject: [PATCH] fix: document value of service key and add links to CI env docs --- README.md | 26 +++++++++++------------ index.js | 2 +- lib/appveyor.js | 2 +- lib/{circle.js => circleci.js} | 2 +- lib/codeship.js | 2 +- lib/drone.js | 2 +- lib/travis.js | 2 +- test/{circle.test.js => circleci.test.js} | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) rename lib/{circle.js => circleci.js} (91%) rename test/{circle.test.js => circleci.test.js} (96%) diff --git a/README.md b/README.md index 086ff99..f064751 100644 --- a/README.md +++ b/README.md @@ -39,18 +39,18 @@ const {isCi, service, commit, build, branch, job, pr, isPr, slug, root} = envCi( ## Supported CI -| Service | `isCi` | `service` | `commit` | `build` | `branch` | `job` | `pr` | `isPr` | `slug` | `root` | -|-------------------------------------------------------------|:------:|:---------:|:--------:|:-------:|:--------:|:-----:|:----:|:------:|:------:|:------:| -| [AppVeyor](https://www.appveyor.com) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [Buildkite](https://buildkite.com) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | -| [Circleci](https://circleci.com) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | -| [Codeship](https://codeship.com) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ | -| [Drone](http://try.drone.io) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | -| [Gitlab CI](https://about.gitlab.com/features/gitlab-ci-cd) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | -| [Jenkins](https://jenkins-ci.org) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | -| [Semaphore](https://semaphoreci.com) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [Shippable](https://www.shippable.com) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [Travis](https://travis-ci.org/) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [Wercker](http://www.wercker.com/) | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | +| CI Service | `service` | `isCi` | `commit` | `build` | `branch` | `job` | `pr` | `isPr` | `slug` | `root` | +|-----------------------------------------------------------------------------------------------------------|:-----------:|:------:|:--------:|:-------:|:--------:|:-----:|:----:|:------:|:------:|:------:| +| [AppVeyor]( https://www.appveyor.com/docs/environment-variables) | `appveyor` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [Buildkite](https://buildkite.com/docs/builds/environment-variables) | `buildkite` | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | +| [Circleci](https://circleci.com/docs/1.0/environment-variables) | `circleci` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | +| [Codeship](https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables) | `codeship` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ | +| [Drone](http://readme.drone.io/0.5/usage/environment-reference) | `drone` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | +| [Gitlab CI](https://docs.gitlab.com/ce/ci/variables/README.html) | `gitlab` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | +| [Jenkins](https://wiki.jenkins.io/display/JENKINS/Building+a+software+project) | `jenkins` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | +| [Semaphore](https://semaphoreci.com/docs/available-environment-variables.html) | `semaphore` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [Shippable](http://docs.shippable.com/ci/env-vars/#stdEnv) | `shippable` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [Travis](https://docs.travis-ci.com/user/environment-variables) | `travis` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [Wercker](http://devcenter.wercker.com/docs/environment-variables/available-env-vars#hs_cos_wrapper_name) | `wercker` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | If none of the above CI services is detected, `commit` and `branch` are determined based on the local Git repository, and `isCi` is determined based on the `CI` environment variable. diff --git a/index.js b/index.js index d9e9281..b7718af 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const git = require('./lib/git'); const services = { travis: require('./lib/travis'), - circle: require('./lib/circle'), + circleci: require('./lib/circleci'), appveyor: require('./lib/appveyor'), wercker: require('./lib/wercker'), codeship: require('./lib/codeship'), diff --git a/lib/appveyor.js b/lib/appveyor.js index 85d0a93..9eb11c9 100644 --- a/lib/appveyor.js +++ b/lib/appveyor.js @@ -1,4 +1,4 @@ -// https://www.appveyor.com/docs/environment-variables/ +// https://www.appveyor.com/docs/environment-variables module.exports = { detect() { diff --git a/lib/circle.js b/lib/circleci.js similarity index 91% rename from lib/circle.js rename to lib/circleci.js index 88e435f..b9f752f 100644 --- a/lib/circle.js +++ b/lib/circleci.js @@ -1,4 +1,4 @@ -// https://circleci.com/docs/1.0/environment-variables/ +// https://circleci.com/docs/1.0/environment-variables module.exports = { detect() { diff --git a/lib/codeship.js b/lib/codeship.js index 8867c6c..23d8621 100644 --- a/lib/codeship.js +++ b/lib/codeship.js @@ -1,4 +1,4 @@ -// https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables/ +// https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables module.exports = { detect() { diff --git a/lib/drone.js b/lib/drone.js index f8e1098..d8f5f93 100644 --- a/lib/drone.js +++ b/lib/drone.js @@ -1,4 +1,4 @@ -// http://readme.drone.io/0.5/usage/environment-reference/ +// http://readme.drone.io/0.5/usage/environment-reference module.exports = { detect() { diff --git a/lib/travis.js b/lib/travis.js index 9f66fa2..3ebca65 100644 --- a/lib/travis.js +++ b/lib/travis.js @@ -1,4 +1,4 @@ -// https://docs.travis-ci.com/user/environment-variables/ +// https://docs.travis-ci.com/user/environment-variables module.exports = { detect() { diff --git a/test/circle.test.js b/test/circleci.test.js similarity index 96% rename from test/circle.test.js rename to test/circleci.test.js index 7400ed0..d9b1b10 100644 --- a/test/circle.test.js +++ b/test/circleci.test.js @@ -1,5 +1,5 @@ import test from 'ava'; -import circle from '../lib/circle'; +import circle from '../lib/circleci'; test('Push', t => { process.env.CIRCLECI = 'true';