From 88953dac90a4ae623637f83052a865b5727f7e6e Mon Sep 17 00:00:00 2001 From: Ben Prescott Date: Thu, 24 Oct 2019 16:08:30 +0100 Subject: [PATCH 01/14] Docs: variables missing during CI pipeline creation --- doc/ci/variables/README.md | 3 + .../variables/where_variables_can_be_used.md | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index cff797549ba338..2e17327bdb290d 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -595,6 +595,9 @@ output **will** contain the content of all your variables and any other secrets! The output **will** be uploaded to the GitLab server and made visible in job logs! +[Some of the variables](where_variables_can_be_used.md) in the debug output +are not available for use in `.gitlab-ci.yml`. + By default, GitLab Runner hides most of the details of what it is doing when processing a job. This behavior keeps job logs short, and prevents secrets from being leaked into the log unless your script writes them to the screen. diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md index b5296f2626909e..cb08bafb411704 100644 --- a/doc/ci/variables/where_variables_can_be_used.md +++ b/doc/ci/variables/where_variables_can_be_used.md @@ -32,6 +32,66 @@ There are two places defined variables can be used. On the: | `script`, `before_script`, `after_script` | yes | Script execution shell | The variable expansion is made by the [execution shell environment](#execution-shell-environment) | | `only:variables:[]`, `except:variables:[]` | no | n/a | The variable must be in the form of `$variable`. Not supported are the following:

- Variables that are based on the environment's name (`CI_ENVIRONMENT_NAME`, `CI_ENVIRONMENT_SLUG`).
- Any other variables related to environment (currently only `CI_ENVIRONMENT_URL`).
- [Persisted variables](#persisted-variables). | +If you are using runner debugging to see what variables are created by GitLab, not all of them are available for use by syntax in `.gitlab-ci.yml`. + +For example: if you're using rules or only/except policies to determine whether jobs are created, some of the variables in the debug output on the shell runner are not present during pipeline creation. + +- Those created by the shell runner: + +``` +CI_RUNNER_DESCRIPTION +CI_RUNNER_EXECUTABLE_ARCH +CI_RUNNER_ID +CI_RUNNER_REVISION +CI_RUNNER_SHORT_TOKEN +CI_RUNNER_TAGS +CI_RUNNER_VERSION +CONFIG_FILE +``` + +- Those derived from the shell runner's environment, such as: + +``` +HOME +PATH +SHELL +``` + +- The following are also not available: + +``` +CI_BUILD_ID +CI_BUILDS_DIR +CI_BUILD_TOKEN +CI_CONCURRENT_ID +CI_CONCURRENT_PROJECT_ID +CI_JOB_ID +CI_JOB_TOKEN +CI_JOB_URL +CI_PIPELINE_ID +CI_PIPELINE_URL +CI_PROJECT_DIR +CI_REGISTRY_PASSWORD +CI_REGISTRY_USER +CI_REPOSITORY_URL +CI_SERVER_TLS_CA_FILE +CI_SERVER +CI_SHARED_ENVIRONMENT +FF_CMD_DISABLE_DELAYED_ERROR_LEVEL_EXPANSION +FF_USE_LEGACY_BUILDS_DIR_FOR_DOCKER +FF_USE_LEGACY_VOLUMES_MOUNTING_ORDER +``` + +During your development and testing of your CI logic, consider verifing the presence +of variables you haven't created yourself before relying on them in your logic: + +```yaml +test_job_name: + script: /usr/bin/true + rules: + - if: '$CI_VARIABLE_NAME' +``` + ### `config.toml` file NOTE: **Note:** -- GitLab From fa599aa813a37956d2cbc066cc60319fb08674c7 Mon Sep 17 00:00:00 2001 From: Ben Prescott Date: Fri, 22 Nov 2019 11:56:26 +0000 Subject: [PATCH 02/14] Docs: rules can also use ci variable expressions --- doc/ci/variables/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 2e17327bdb290d..1fa8b9c7e5a950 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -471,11 +471,14 @@ value you set for this specific pipeline: ## Environment variables expressions -> Introduced in GitLab 10.7. +> Introduced in GitLab 10.7. (only/except) +> Introduced in GitLab 12.3. (rules) -It is possible to use variables expressions with only / except policies in -`.gitlab-ci.yml`. By using this approach you can limit what jobs are going to -be created within a pipeline after pushing a code to GitLab. +Variable expressions can be used to limit what jobs are going to be created +within a pipeline after pushing a code to GitLab. + +This can be done in `.gitlab-ci.yml` preferably with [rules](../yaml/README.html#rules) but +also with only / except policies, which are [now deprecated.](../yaml/README.html#onlyexcept-basic) This is particularly useful in combination with variables and triggered pipeline variables. @@ -498,6 +501,8 @@ when `except` is being used, a job is not going to be created. This follows usual rules for [`only` / `except` policies](../yaml/README.md#onlyexcept-advanced). +The [rules documentation](../yaml/README.html#rules) has examples that use variables. + ### Supported syntax Below you can find supported syntax reference: -- GitLab From bb54998021756741b77c9eb60628480ccac4dbd9 Mon Sep 17 00:00:00 2001 From: Ben Prescott Date: Fri, 22 Nov 2019 13:22:05 +0000 Subject: [PATCH 03/14] Docs: ci variables with limited regexes --- doc/ci/variables/README.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 1fa8b9c7e5a950..a559f2d23fec12 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -570,9 +570,8 @@ Below you can find supported syntax reference: - `$VARIABLE =~ /^content.*/` - `$VARIABLE_1 !~ /^content.*/` (introduced in GitLab 11.11) - It is possible perform pattern matching against a variable and regular - expression. Expression like this evaluates to truth if matches are found - when using `=~`. It evaluates to truth if matches are not found when `!~` is used. + Expressions like this evaluate to truth if matches are found when using `=~`. + It evaluates to truth if matches are not found when `!~` is used. Pattern matching is case-sensitive by default. Use `i` flag modifier, like `/pattern/i` to make a pattern case-insensitive. @@ -590,6 +589,25 @@ Below you can find supported syntax reference: Precedence of operators follows standard Ruby 2.5 operation [precedence](https://ruby-doc.org/core-2.5.0/doc/syntax/precedence_rdoc.html). +### Pattern matching against a variable + +It is possible perform pattern matching against a variable containing a regular expression. + +NOTE: **Note:** +Not all regular expression syntax works because of a [bug.](https://gitlab.com/gitlab-org/gitlab/issues/35438) +Confirm this by directly testing the regular expression, for example: `- if: '$RELEASE =~ /staging.*/'` + +```yaml +variables: + STAGINGRELS: '/staging0|staging1/' + +deploy_staging: + script: do.sh deploy staging + environment: staging + rules: + - if: '$RELEASE =~ $STAGINGRELS' +``` + ## Debug logging > Introduced in GitLab Runner 1.7. -- GitLab From fa3b244fc52d5d42a88dc74b4dfd8ca0368259fa Mon Sep 17 00:00:00 2001 From: Ben Prescott Date: Wed, 27 Nov 2019 15:17:17 +0000 Subject: [PATCH 04/14] Docs: ci conjunction/disjunction precedence --- doc/ci/variables/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index a559f2d23fec12..2075fa796b5fff 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -586,7 +586,7 @@ Below you can find supported syntax reference: It is possible to join multiple conditions using `&&` or `||`. Any of the otherwise supported syntax may be used in a conjunctive or disjunctive statement. - Precedence of operators follows standard Ruby 2.5 operation + Precedence of operators: `&&` happens before `||`, following Ruby 2.5 [precedence](https://ruby-doc.org/core-2.5.0/doc/syntax/precedence_rdoc.html). ### Pattern matching against a variable -- GitLab From 5d49750a9cd1bf48df75a13a1c3560748be87b90 Mon Sep 17 00:00:00 2001 From: "Ben Prescott (work)" Date: Fri, 29 Nov 2019 10:22:41 +0000 Subject: [PATCH 05/14] Docs: Improvements to proposed CI changes --- doc/ci/variables/README.md | 27 +++++++++---------- .../variables/where_variables_can_be_used.md | 10 ++++--- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 2075fa796b5fff..901013518f0b3f 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -471,14 +471,13 @@ value you set for this specific pipeline: ## Environment variables expressions -> Introduced in GitLab 10.7. (only/except) -> Introduced in GitLab 12.3. (rules) +> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/37397) in GitLab 10.7 for [the `only` and `except` CI keywords](../yaml/README.md#onlyexcept-advanced) +> - [Expanded](https://gitlab.com/gitlab-org/gitlab/issues/27863) in GitLab 12.3 with [the `rules` keyword](../yaml/README.html#rules) Variable expressions can be used to limit what jobs are going to be created -within a pipeline after pushing a code to GitLab. +within a pipeline after pushing changes to GitLab. -This can be done in `.gitlab-ci.yml` preferably with [rules](../yaml/README.html#rules) but -also with only / except policies, which are [now deprecated.](../yaml/README.html#onlyexcept-basic) +Originally, this was configured with [`only` and `except`](../yaml/README.html#onlyexcept-basic) in the `.gitlab-ci.yml`, but this is now deprecated. Variable expressions should now only be used with [`rules`](../yaml/README.html#rules). This is particularly useful in combination with variables and triggered pipeline variables. @@ -501,8 +500,6 @@ when `except` is being used, a job is not going to be created. This follows usual rules for [`only` / `except` policies](../yaml/README.md#onlyexcept-advanced). -The [rules documentation](../yaml/README.html#rules) has examples that use variables. - ### Supported syntax Below you can find supported syntax reference: @@ -567,11 +564,8 @@ Below you can find supported syntax reference: Examples: - - `$VARIABLE =~ /^content.*/` - - `$VARIABLE_1 !~ /^content.*/` (introduced in GitLab 11.11) - - Expressions like this evaluate to truth if matches are found when using `=~`. - It evaluates to truth if matches are not found when `!~` is used. + - `=~`: True if pattern is matched. Ex: `$VARIABLE =~ /^content.*/` + - `!~`: True if pattern is not matched. Ex: `$VARIABLE_1 !~ /^content.*/` ([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/61900) in GitLab 11.11) Pattern matching is case-sensitive by default. Use `i` flag modifier, like `/pattern/i` to make a pattern case-insensitive. @@ -591,11 +585,14 @@ Below you can find supported syntax reference: ### Pattern matching against a variable -It is possible perform pattern matching against a variable containing a regular expression. +It is possible to store a regular expression in a variable, to be used for pattern matching. NOTE: **Note:** -Not all regular expression syntax works because of a [bug.](https://gitlab.com/gitlab-org/gitlab/issues/35438) -Confirm this by directly testing the regular expression, for example: `- if: '$RELEASE =~ /staging.*/'` +The available regular expression syntax is limited. See [related issue](https://gitlab.com/gitlab-org/gitlab/issues/35438) +for more details. You may need to test your expression in a test pipeline to verify +it works as intended. + +For example, test the `staging.*` regular expression by adding it to a test pipeline: ```yaml variables: diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md index cb08bafb411704..e9edb178dfd56c 100644 --- a/doc/ci/variables/where_variables_can_be_used.md +++ b/doc/ci/variables/where_variables_can_be_used.md @@ -32,9 +32,11 @@ There are two places defined variables can be used. On the: | `script`, `before_script`, `after_script` | yes | Script execution shell | The variable expansion is made by the [execution shell environment](#execution-shell-environment) | | `only:variables:[]`, `except:variables:[]` | no | n/a | The variable must be in the form of `$variable`. Not supported are the following:

- Variables that are based on the environment's name (`CI_ENVIRONMENT_NAME`, `CI_ENVIRONMENT_SLUG`).
- Any other variables related to environment (currently only `CI_ENVIRONMENT_URL`).
- [Persisted variables](#persisted-variables). | -If you are using runner debugging to see what variables are created by GitLab, not all of them are available for use by syntax in `.gitlab-ci.yml`. +If you are using runner debugging to see what variables are created by GitLab, not all of them are available for use in `.gitlab-ci.yml`. -For example: if you're using rules or only/except policies to determine whether jobs are created, some of the variables in the debug output on the shell runner are not present during pipeline creation. +For example: if you're using [`rules`](../yaml/README.html#rules), or [`only` / `except`](../yaml/README.html#onlyexcept-basic) +to determine whether or not jobs are created, some of the variables in the debug output on the shell +runner are not available during pipeline creation. - Those created by the shell runner: @@ -82,8 +84,8 @@ FF_USE_LEGACY_BUILDS_DIR_FOR_DOCKER FF_USE_LEGACY_VOLUMES_MOUNTING_ORDER ``` -During your development and testing of your CI logic, consider verifing the presence -of variables you haven't created yourself before relying on them in your logic: +During development and testing of your CI configuration, consider verifying the presence +of variables you haven't created yourself in a test job, before relying on them: ```yaml test_job_name: -- GitLab From 3de8c045edf638d4a024d3175b8dbe8bc7b1cfcd Mon Sep 17 00:00:00 2001 From: Ben Prescott Date: Fri, 29 Nov 2019 10:59:11 +0000 Subject: [PATCH 06/14] Docs: clarify how to test regex in variables --- doc/ci/variables/README.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 901013518f0b3f..ad446c782c4c99 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -585,14 +585,7 @@ Below you can find supported syntax reference: ### Pattern matching against a variable -It is possible to store a regular expression in a variable, to be used for pattern matching. - -NOTE: **Note:** -The available regular expression syntax is limited. See [related issue](https://gitlab.com/gitlab-org/gitlab/issues/35438) -for more details. You may need to test your expression in a test pipeline to verify -it works as intended. - -For example, test the `staging.*` regular expression by adding it to a test pipeline: +It is possible to store a regular expression in a variable, to be used for pattern matching: ```yaml variables: @@ -605,6 +598,28 @@ deploy_staging: - if: '$RELEASE =~ $STAGINGRELS' ``` +NOTE: **Note:** +The available regular expression syntax is limited. See [related issue](https://gitlab.com/gitlab-org/gitlab/issues/35438) +for more details. + +Use a test pipeline to determine whether a regular expression will work in a variable. For example: + +```yaml +variables: + MYSTRING: 'master' + MYREGEX: '/^mast.*/' + +testdirect: + script: /bin/true + rules: + - if: '$MYSTRING =~ /^mast.*/' + +testvariable: + script: /bin/true + rules: + - if: '$MYSTRING =~ $MYREGEX' +``` + ## Debug logging > Introduced in GitLab Runner 1.7. -- GitLab From e9526a62d1bf0d81d0c8d608ceadc027f1d21963 Mon Sep 17 00:00:00 2001 From: Ben Prescott Date: Fri, 29 Nov 2019 12:54:23 +0000 Subject: [PATCH 07/14] Docs: ensure example works on more distributions --- doc/ci/variables/where_variables_can_be_used.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md index e9edb178dfd56c..14230da525eb30 100644 --- a/doc/ci/variables/where_variables_can_be_used.md +++ b/doc/ci/variables/where_variables_can_be_used.md @@ -89,7 +89,7 @@ of variables you haven't created yourself in a test job, before relying on them: ```yaml test_job_name: - script: /usr/bin/true + script: /bin/true rules: - if: '$CI_VARIABLE_NAME' ``` -- GitLab From 1d50a6b6e54227651fd5348411cbb8daeed31a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Thu, 5 Dec 2019 08:43:21 +0000 Subject: [PATCH 08/14] Apply suggestion to doc/ci/variables/README.md --- doc/ci/variables/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index ad446c782c4c99..6f64b543180fb5 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -580,8 +580,8 @@ Below you can find supported syntax reference: It is possible to join multiple conditions using `&&` or `||`. Any of the otherwise supported syntax may be used in a conjunctive or disjunctive statement. - Precedence of operators: `&&` happens before `||`, following Ruby 2.5 - [precedence](https://ruby-doc.org/core-2.5.0/doc/syntax/precedence_rdoc.html). + Precedence of operators follows the [ruby 2.5 standard](https://ruby-doc.org/core-2.5.0/doc/syntax/precedence_rdoc.html), + so `&&` is evaluated before `||`. ### Pattern matching against a variable -- GitLab From 0831f9941606c24c9940e78c90661340f7fe5e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Thu, 5 Dec 2019 08:43:41 +0000 Subject: [PATCH 09/14] Apply suggestion to doc/ci/variables/README.md --- doc/ci/variables/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 6f64b543180fb5..0fe5faaeb67d2c 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -583,7 +583,7 @@ Below you can find supported syntax reference: Precedence of operators follows the [ruby 2.5 standard](https://ruby-doc.org/core-2.5.0/doc/syntax/precedence_rdoc.html), so `&&` is evaluated before `||`. -### Pattern matching against a variable +### Storing regular expressions in variables It is possible to store a regular expression in a variable, to be used for pattern matching: -- GitLab From 2464b21618b72598076b843853ab56f4e6a936a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Thu, 5 Dec 2019 08:44:06 +0000 Subject: [PATCH 10/14] Apply suggestion to doc/ci/variables/README.md --- doc/ci/variables/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 0fe5faaeb67d2c..41f1109b0cccce 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -602,7 +602,9 @@ NOTE: **Note:** The available regular expression syntax is limited. See [related issue](https://gitlab.com/gitlab-org/gitlab/issues/35438) for more details. -Use a test pipeline to determine whether a regular expression will work in a variable. For example: +If needed, you can use a test pipeline to determine whether a regular expression will +work in a variable. The example below tests the `^mast.*` regular expression directly, +as well as from within a variable: ```yaml variables: -- GitLab From 4690ab766fd984fabba81be5fde9d412185b75e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Thu, 5 Dec 2019 08:44:56 +0000 Subject: [PATCH 11/14] Apply suggestion to doc/ci/variables/README.md --- doc/ci/variables/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 41f1109b0cccce..63a18e6fb530ba 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -633,7 +633,8 @@ secrets! The output **will** be uploaded to the GitLab server and made visible in job logs! [Some of the variables](where_variables_can_be_used.md) in the debug output -are not available for use in `.gitlab-ci.yml`. +Not all variables in the debug output are [available for use](where_variables_can_be_used.md) +in `.gitlab-ci.yml`. By default, GitLab Runner hides most of the details of what it is doing when processing a job. This behavior keeps job logs short, and prevents secrets -- GitLab From 0b26645bce4f2d2a94b8883ce6119f2adaf66167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Tue, 14 Apr 2020 06:49:27 +0000 Subject: [PATCH 12/14] Apply suggestion to doc/ci/variables/where_variables_can_be_used.md --- doc/ci/variables/where_variables_can_be_used.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md index 14230da525eb30..12b7621d7e7207 100644 --- a/doc/ci/variables/where_variables_can_be_used.md +++ b/doc/ci/variables/where_variables_can_be_used.md @@ -32,7 +32,8 @@ There are two places defined variables can be used. On the: | `script`, `before_script`, `after_script` | yes | Script execution shell | The variable expansion is made by the [execution shell environment](#execution-shell-environment) | | `only:variables:[]`, `except:variables:[]` | no | n/a | The variable must be in the form of `$variable`. Not supported are the following:

- Variables that are based on the environment's name (`CI_ENVIRONMENT_NAME`, `CI_ENVIRONMENT_SLUG`).
- Any other variables related to environment (currently only `CI_ENVIRONMENT_URL`).
- [Persisted variables](#persisted-variables). | -If you are using runner debugging to see what variables are created by GitLab, not all of them are available for use in `.gitlab-ci.yml`. +Not all variables shown when using [runner debugging](https://docs.gitlab.com/runner/commands/#running-in-debug-mode) +are available for use in `.gitlab-ci.yml`. For example: if you're using [`rules`](../yaml/README.html#rules), or [`only` / `except`](../yaml/README.html#onlyexcept-basic) to determine whether or not jobs are created, some of the variables in the debug output on the shell -- GitLab From 7020079096a930dfebef3992514f476c9ea11922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Tue, 14 Apr 2020 06:50:36 +0000 Subject: [PATCH 13/14] Apply suggestion to doc/ci/variables/where_variables_can_be_used.md --- doc/ci/variables/where_variables_can_be_used.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md index 12b7621d7e7207..d9846afdb902c3 100644 --- a/doc/ci/variables/where_variables_can_be_used.md +++ b/doc/ci/variables/where_variables_can_be_used.md @@ -36,10 +36,8 @@ Not all variables shown when using [runner debugging](https://docs.gitlab.com/ru are available for use in `.gitlab-ci.yml`. For example: if you're using [`rules`](../yaml/README.html#rules), or [`only` / `except`](../yaml/README.html#onlyexcept-basic) -to determine whether or not jobs are created, some of the variables in the debug output on the shell -runner are not available during pipeline creation. - -- Those created by the shell runner: +to determine whether or not jobs are created, the debug output on the shell runner +may show the following variables, but they are not available for use in `.gitlab-ci.yml`: ``` CI_RUNNER_DESCRIPTION -- GitLab From e843ed21f2441af84d3008bef75cc10a82acd4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Prescott=20=40bprescott=5F=E2=86=99=20=E2=98=BA?= Date: Tue, 14 Apr 2020 06:50:52 +0000 Subject: [PATCH 14/14] Apply suggestion to doc/ci/variables/where_variables_can_be_used.md --- doc/ci/variables/where_variables_can_be_used.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md index d9846afdb902c3..45dae250d8ac1b 100644 --- a/doc/ci/variables/where_variables_can_be_used.md +++ b/doc/ci/variables/where_variables_can_be_used.md @@ -50,7 +50,7 @@ CI_RUNNER_VERSION CONFIG_FILE ``` -- Those derived from the shell runner's environment, such as: +Variables derived from the shell runner's environment are also not available, such as: ``` HOME -- GitLab