From 3c2acb3acfcc95eead03403f6593201391ead8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Sat, 27 Oct 2018 19:12:48 +0200 Subject: Add documentation entries --- doc/ci/variables/README.md | 2 ++ doc/ci/yaml/README.md | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 2d23bf6d2fd..0ddbc828d1a 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -65,6 +65,8 @@ future GitLab releases.** | **CI_JOB_NAME** | 9.0 | 0.5 | The name of the job as defined in `.gitlab-ci.yml` | | **CI_JOB_STAGE** | 9.0 | 0.5 | The name of the stage as defined in `.gitlab-ci.yml` | | **CI_JOB_TOKEN** | 9.0 | 1.2 | Token used for authenticating with the [GitLab Container Registry][registry] and downloading [dependent repositories][dependent-repositories] | +| **CI_NODE_INDEX** | 11.5 | all | The index of the job in the whole set. If the job is not paralellized, this is not set. | +| **CI_NODE_TOTAL** | 11.5 | all | The total number of instances of this job running in parallel. If the job is not paralellized, this is set to 1. | | **CI_JOB_URL** | 11.1 | 0.5 | Job details URL | | **CI_REPOSITORY_URL** | 9.0 | all | The URL to clone the Git repository | | **CI_RUNNER_DESCRIPTION** | 8.10 | 0.5 | The description of the runner as saved in GitLab | diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 981aa101dd3..4801d5d42e7 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -75,6 +75,7 @@ A job is defined by a list of parameters that define the job behavior. | environment | no | Defines a name of environment to which deployment is done by this job | | coverage | no | Define code coverage settings for a given job | | retry | no | Define how many times a job can be auto-retried in case of a failure | +| parallel | no | Define how many duplicates of a job should be run in parallel | ### `extends` @@ -1451,6 +1452,28 @@ test: retry: 2 ``` +## `parallel` + +> [Introduced][ce-22631] in GitLab 11.5. + +`parallel` allows you to configure how many duplicates of a job will be run in +parallel. This value has to be greater or equal to two (2). + +This creates N duplicates of the same job that run in parallel. They're named +sequentially from `job_name 1/N` to `job_name N/N`. + +For every job `CI_NODE_INDEX` and `CI_NODE_TOTAL` environment variables are set. +`CI_NODE_TOTAL` represents the total number of jobs while `CI_NODE_INDEX` is the +index of the job in the whole set. + +A simple example: + +```yaml +test: + script: rspec + parallel: 5 +``` + ## `include` > Introduced in [GitLab Edition Premium][ee] 10.5. @@ -2031,7 +2054,8 @@ CI with various languages. [ce-7983]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7983 [ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447 [ce-12909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909 +[ce-22631]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22631 [schedules]: ../../user/project/pipelines/schedules.md [variables-expressions]: ../variables/README.md#variables-expressions [ee]: https://about.gitlab.com/gitlab-ee/ -[gitlab-versions]: https://about.gitlab.com/products/ \ No newline at end of file +[gitlab-versions]: https://about.gitlab.com/products/ -- cgit v1.2.1