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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
173e0a7c
Commit
173e0a7c
authored
Aug 29, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation about hidden keys in CI YAML
parent
2991f93f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+12
-9
No files found.
doc/ci/yaml/README.md
View file @
173e0a7c
...
@@ -39,7 +39,7 @@ If you want a quick introduction to GitLab CI, follow our
...
@@ -39,7 +39,7 @@ If you want a quick introduction to GitLab CI, follow our
-
[
before_script and after_script
](
#before_script-and-after_script
)
-
[
before_script and after_script
](
#before_script-and-after_script
)
-
[
Git Strategy
](
#git-strategy
)
-
[
Git Strategy
](
#git-strategy
)
-
[
Shallow cloning
](
#shallow-cloning
)
-
[
Shallow cloning
](
#shallow-cloning
)
-
[
Hidden
jobs
](
#hidden-job
s
)
-
[
Hidden
keys
](
#hidden-key
s
)
-
[
Special YAML features
](
#special-yaml-features
)
-
[
Special YAML features
](
#special-yaml-features
)
-
[
Anchors
](
#anchors
)
-
[
Anchors
](
#anchors
)
-
[
Validate the .gitlab-ci.yml
](
#validate-the-gitlab-ci-yml
)
-
[
Validate the .gitlab-ci.yml
](
#validate-the-gitlab-ci-yml
)
...
@@ -934,24 +934,27 @@ variables:
...
@@ -934,24 +934,27 @@ variables:
GIT_DEPTH: "3"
GIT_DEPTH: "3"
```
```
## Hidden
job
s
## Hidden
key
s
>**Note:**
>**Note:**
Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
Job
s that start with a dot (
`.`
) will be not processed by GitLab CI. You can
Key
s that start with a dot (
`.`
) will be not processed by GitLab CI. You can
use this feature to ignore jobs, or use the
use this feature to ignore jobs, or use the
[
special YAML features
](
#special-yaml-features
)
and transform the hidden
job
s
[
special YAML features
](
#special-yaml-features
)
and transform the hidden
key
s
into templates.
into templates.
In the following example,
`.
job
_name`
will be ignored:
In the following example,
`.
key
_name`
will be ignored:
```
yaml
```
yaml
.
job
_name
:
.
key
_name
:
script
:
script
:
-
rake spec
-
rake spec
```
```
Hidden keys can be hashes like normal CI jobs, but you are also allowed to use
different types of structures to leverage special YAML features.
## Special YAML features
## Special YAML features
It's possible to use special YAML features like anchors (
`&`
), aliases (
`*`
)
It's possible to use special YAML features like anchors (
`&`
), aliases (
`*`
)
...
@@ -967,7 +970,7 @@ Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
...
@@ -967,7 +970,7 @@ Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
YAML also has a handy feature called 'anchors', which let you easily duplicate
YAML also has a handy feature called 'anchors', which let you easily duplicate
content across your document. Anchors can be used to duplicate/inherit
content across your document. Anchors can be used to duplicate/inherit
properties, and is a perfect example to be used with
[
hidden
jobs
](
#hidden-job
s
)
properties, and is a perfect example to be used with
[
hidden
keys
](
#hidden-key
s
)
to provide templates for your jobs.
to provide templates for your jobs.
The following example uses anchors and map merging. It will create two jobs,
The following example uses anchors and map merging. It will create two jobs,
...
@@ -975,7 +978,7 @@ The following example uses anchors and map merging. It will create two jobs,
...
@@ -975,7 +978,7 @@ The following example uses anchors and map merging. It will create two jobs,
having their own custom
`script`
defined:
having their own custom
`script`
defined:
```
yaml
```
yaml
.job_template
:
&job_definition
# Hidden
job
that defines an anchor named 'job_definition'
.job_template
:
&job_definition
# Hidden
key
that defines an anchor named 'job_definition'
image
:
ruby:2.1
image
:
ruby:2.1
services
:
services
:
-
postgres
-
postgres
...
@@ -1081,7 +1084,7 @@ test:mysql:
...
@@ -1081,7 +1084,7 @@ test:mysql:
-
ruby
-
ruby
```
```
You can see that the hidden
job
s are conveniently used as templates.
You can see that the hidden
key
s are conveniently used as templates.
## Validate the .gitlab-ci.yml
## Validate the .gitlab-ci.yml
...
...
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