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
88799b2c
Commit
88799b2c
authored
Oct 22, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation about script flattening
parent
ca1ff463
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+46
-0
No files found.
doc/ci/yaml/README.md
View file @
88799b2c
...
...
@@ -181,6 +181,25 @@ that the YAML parser knows to interpret the whole thing as a string rather than
a "key: value" pair. Be careful when using special characters:
`:`
,
`{`
,
`}`
,
`[`
,
`]`
,
`,`
,
`&`
,
`*`
,
`#`
,
`?`
,
`|`
,
`-`
,
`<`
,
`>`
,
`=`
,
`!`
,
`%`
,
`@`
,
`` ` ``
.
#### YAML anchors for `script`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/23005) in GitLab 12.5.
You can use
[
YAML anchors
](
#anchors
)
with scripts, which makes it possible to
include a predefined list of commands in multiple jobs.
Example:
```
yaml
.something
:
&something
-
echo 'something'
job_name
:
script
:
-
*something
-
echo 'this is the script'
```
### `image`
Used to specify
[
a Docker image
](
../docker/using_docker_images.md#what-is-an-image
)
to use for the job.
...
...
@@ -284,6 +303,33 @@ job:
-
execute this after my script
```
#### YAML anchors for `before_script` and `after_script`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/23005) in GitLab 12.5.
You can use
[
YAML anchors
](
#anchors
)
with
`before_script`
and
`after_script`
,
which makes it possible to include a predefined list of commands in multiple
jobs.
Example:
```
yaml
.something_before
:
&something_before
-
echo 'something before'
.something_after
:
&something_after
-
echo 'something after'
job_name
:
before_script
:
-
*something_before
script
:
-
echo 'this is the script'
after_script
:
-
*something_after
```
### `stages`
`stages`
is used to define stages that can be used by jobs and is defined
...
...
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