ci-parallel-vars
Advanced tools
Comparing version 1.0.0 to 1.0.1
10
index.js
@@ -9,3 +9,3 @@ // @flow | ||
const envs = [ | ||
// Knapsack / TravisCI | ||
// Knapsack / TravisCI / GitLab | ||
{ | ||
@@ -30,2 +30,7 @@ index: 'CI_NODE_INDEX', | ||
}, | ||
// Semaphore | ||
{ | ||
index: 'SEMAPHORE_CURRENT_JOB', | ||
total: 'SEMAPHORE_JOB_COUNT', | ||
}, | ||
]; | ||
@@ -45,2 +50,5 @@ | ||
if (index !== null && total !== null) { | ||
if (process.env.GITLAB_CI) { | ||
index = index - 1; | ||
} | ||
match = { index, total }; | ||
@@ -47,0 +55,0 @@ break; |
{ | ||
"name": "ci-parallel-vars", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Get CI environment variables for parallelizing builds", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,6 +24,7 @@ # ci-parallel-vars | ||
- [Knapsack] / [TravisCI]: `CI_NODE_INDEX`/`CI_NODE_TOTAL` | ||
- [CircleCI]: `CIRCLE_NODE_INDEX`/`CIRCLE_NODE_TOTAL` | ||
- [Bitbucket Pipelines]: `BITBUCKET_PARALLEL_STEP`/`BITBUCKET_PARALLEL_STEP_COUNT`', | ||
- [Buildkite]: `BUILDKITE_PARALLEL_JOB`/`BUILDKITE_PARALLEL_JOB_COUNT` | ||
- [Knapsack] / [TravisCI] / [GitLab] - `CI_NODE_INDEX`/`CI_NODE_TOTAL` | ||
- [CircleCI] - `CIRCLE_NODE_INDEX`/`CIRCLE_NODE_TOTAL` | ||
- [Bitbucket Pipelines] - `BITBUCKET_PARALLEL_STEP`/`BITBUCKET_PARALLEL_STEP_COUNT` | ||
- [Buildkite] - `BUILDKITE_PARALLEL_JOB`/`BUILDKITE_PARALLEL_JOB_COUNT` | ||
- [Semaphore] - `SEMAPHORE_CURRENT_JOB`/`SEMAPHORE_JOB_COUNT` | ||
@@ -35,4 +36,6 @@ One of these pairs must both be defined as numbers or `ci-parallel-vars` will | ||
[TravisCI]: https://docs.travis-ci.com/user/speeding-up-the-build/#Parallelizing-RSpec%2C-Cucumber-and-Minitest-on-multiple-VMs | ||
[GitLab]: https://docs.gitlab.com/ee/ci/yaml/#parallel | ||
[CircleCI]: https://circleci.com/docs/1.0/parallel-manual-setup/#using-environment-variables | ||
[Bitbucket Pipelines]: https://confluence.atlassian.com/bitbucket/parallel-steps-946606807.html | ||
[Buildkite]: https://buildkite.com/docs/builds/parallel-builds | ||
[Semaphore]: https://semaphoreci.com/docs/available-environment-variables.html#variables-exported-in-builds-and-deploys |
4266
49
40