Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a5cc5f6e
Commit
a5cc5f6e
authored
Jun 16, 2019
by
Evan Read
Committed by
Achilleas Pipinellis
Jun 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit after script context text
parent
a74c4c6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
doc/ci/variables/where_variables_can_be_used.md
doc/ci/variables/where_variables_can_be_used.md
+5
-4
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+15
-10
No files found.
doc/ci/variables/where_variables_can_be_used.md
View file @
a5cc5f6e
...
@@ -89,13 +89,14 @@ Supported:
...
@@ -89,13 +89,14 @@ Supported:
-
In
`script`
, it will work in the following lines of
`script`
.
-
In
`script`
, it will work in the following lines of
`script`
.
-
In
`after_script`
, it will work in following lines of
`after_script`
.
-
In
`after_script`
, it will work in following lines of
`after_script`
.
Please notice the specific case of
`after_script`
scripts, that
can:
In the case of
`after_script`
scripts, they
can:
-
Only use variables defined before the script within the same
`after_script`
section.
-
Only use variables defined before the script within the same
`after_script`
section.
-
Not use variables defined in
`before_script`
and
`script`
.
-
Not use variables defined in
`before_script`
and
`script`
.
Both restrictions are caused by the fact, that
`after_script`
script is
executed in a
These restrictions are because
`after_script`
scripts are
executed in a
[
separated shell context
](
https://docs.gitlab.com/ee/ci/yaml/README.html
#before_script-and-after_script
)
.
[
separated shell context
](
../yaml/README.md
#before_script-and-after_script
)
.
## Persisted variables
## Persisted variables
...
...
doc/ci/yaml/README.md
View file @
a5cc5f6e
...
@@ -215,20 +215,25 @@ This can be an array or a multi-line string.
...
@@ -215,20 +215,25 @@ This can be an array or a multi-line string.
`after_script`
is used to define the command that will be run after all
`after_script`
is used to define the command that will be run after all
jobs, including failed ones. This has to be an array or a multi-line string.
jobs, including failed ones. This has to be an array or a multi-line string.
Script
specified in
`before_script`
is
:
Script
s specified in
`before_script`
are
:
-
Concatenated with script specified in the main
`script`
. Job-level
`before_script`
definition
-
Concatenated with scripts specified in the main
`script`
. Job-level
override global-level
`before_script`
definition when concatenated with
`script`
definition.
`before_script`
definition override global-level
`before_script`
definition
-
Executed together with main
`script`
script as one script in a single shell context.
when concatenated with
`script`
definition.
-
Executed together with main
`script`
script as one script in a single shell
context.
Script specified in
`after_script`
:
Script
s
specified in
`after_script`
:
-
Have a current working directory set back to the default.
-
Have a current working directory set back to the default.
-
Is executed in a shell context separated from
`before_script`
and
`script`
scripts.
-
Are executed in a shell context separated from
`before_script`
and
`script`
-
Because of separated context, cannot see changes done by scripts defined in
`before_script`
or
`script`
scripts:
scripts.
-
in shell - for example, command aliases and variables exported in
`script`
script,
-
Because of separated context, cannot see changes done by scripts defined
-
outside of the working tree (depending on the Runner executor) - for example, software installed
in
`before_script`
or
`script`
scripts, either:
by a
`before_script`
or
`script`
script.
-
In shell. For example, command aliases and variables exported in
`script`
scripts.
-
Outside of the working tree (depending on the Runner executor). For example,
software installed by a
`before_script`
or
`script`
scripts.
It's possible to overwrite the globally defined
`before_script`
and
`after_script`
It's possible to overwrite the globally defined
`before_script`
and
`after_script`
if you set it per-job:
if you set it per-job:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment