Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
173e0a7c
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
173e0a7c
编写于
8月 29, 2016
作者:
G
Grzegorz Bizon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update documentation about hidden keys in CI YAML
上级
2991f93f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
12 addition
and
9 deletion
+12
-9
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+12
-9
未找到文件。
doc/ci/yaml/README.md
浏览文件 @
173e0a7c
...
...
@@ -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
)
-
[
Git Strategy
](
#git-strategy
)
-
[
Shallow cloning
](
#shallow-cloning
)
-
[
Hidden
jobs
](
#hidden-job
s
)
-
[
Hidden
keys
](
#hidden-key
s
)
-
[
Special YAML features
](
#special-yaml-features
)
-
[
Anchors
](
#anchors
)
-
[
Validate the .gitlab-ci.yml
](
#validate-the-gitlab-ci-yml
)
...
...
@@ -934,24 +934,27 @@ variables:
GIT_DEPTH: "3"
```
## Hidden
job
s
## Hidden
key
s
>**Note:**
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
[
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.
In the following example,
`.
job
_name`
will be ignored:
In the following example,
`.
key
_name`
will be ignored:
```
yaml
.
job
_name
:
.
key
_name
:
script
:
-
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
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.
YAML also has a handy feature called 'anchors', which let you easily duplicate
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.
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:
```
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
services
:
-
postgres
...
...
@@ -1081,7 +1084,7 @@ test:mysql:
-
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录