diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2019-06-12 00:31:44 +0300 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2019-06-12 09:44:17 +0300 |
commit | f4b5f930ff7252468c69cf4decbbb05d44ba3b71 (patch) | |
tree | 25facd3466acfa641ffc427b6b633f701b10bae9 /doc/ci/variables/where_variables_can_be_used.md | |
parent | 9bf141cf718ab9ca770c3bd6b7e2c6719cbe9da7 (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.md | 8 |
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:** |