Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2019-06-12 00:31:44 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2019-06-12 09:44:17 +0300
commitf4b5f930ff7252468c69cf4decbbb05d44ba3b71 (patch)
tree25facd3466acfa641ffc427b6b633f701b10bae9 /doc/ci/variables/where_variables_can_be_used.md
parent9bf141cf718ab9ca770c3bd6b7e2c6719cbe9da7 (diff)
Leave clear notices about after_script execution context
We frequently see new issues mentioning that something defined in `before_script` or `script` doesn't work with `after_script`. Our documentation mentions that first two are concatenated and executed together, why the third one is executed in a separated shell context. But it looks like it's not clear enough. Since this misunderstanding of how scripts are being executed is repeated frequently, let's make it more clear in docs.
Diffstat (limited to 'doc/ci/variables/where_variables_can_be_used.md')
-rw-r--r--doc/ci/variables/where_variables_can_be_used.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/ci/variables/where_variables_can_be_used.md b/doc/ci/variables/where_variables_can_be_used.md
index 8009b1d5e8a..7d3f39a8c19 100644
--- a/doc/ci/variables/where_variables_can_be_used.md
+++ b/doc/ci/variables/where_variables_can_be_used.md
@@ -89,6 +89,14 @@ Supported:
- In `script`, it will work in the following lines of `script`.
- In `after_script`, it will work in following lines of `after_script`.
+Please notice the specific case of `after_script` scripts, that can:
+
+- Only use variables defined before the script within the same `after_script` section.
+- Not use variables defined in `before_script` and `script`.
+
+Both restrictions are caused by the fact, that `after_script` script is executed in a
+[separated shell context](https://docs.gitlab.com/ee/ci/yaml/README.html#before_script-and-after_script).
+
## Persisted variables
NOTE: **Note:**