Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
feae50ff
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,发现更多精彩内容 >>
提交
feae50ff
编写于
7月 12, 2019
作者:
K
Kamil Trzciński
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add usage of `default:`
上级
ae944b36
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
75 addition
and
21 deletion
+75
-21
doc/ci/docker/using_docker_images.md
doc/ci/docker/using_docker_images.md
+20
-17
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+55
-4
未找到文件。
doc/ci/docker/using_docker_images.md
浏览文件 @
feae50ff
...
...
@@ -193,13 +193,14 @@ You can simply define an image that will be used for all jobs and a list of
services that you want to use during build time:
```
yaml
image
:
ruby:2.2
default
:
image
:
ruby:2.2
services
:
-
postgres:9.3
services
:
-
postgres:9.3
before_script
:
-
bundle install
before_script
:
-
bundle install
test
:
script
:
...
...
@@ -209,8 +210,9 @@ test:
It is also possible to define different images and services per job:
```
yaml
before_script
:
-
bundle install
default
:
before_script
:
-
bundle install
test:2.1:
image
:
ruby:2.1
...
...
@@ -231,18 +233,19 @@ Or you can pass some [extended configuration options](#extended-docker-configura
for
`image`
and
`services`
:
```
yaml
image
:
name
:
ruby:2.2
entrypoint
:
[
"
/bin/bash"
]
default
:
image
:
name
:
ruby:2.2
entrypoint
:
[
"
/bin/bash"
]
services
:
-
name
:
my-postgres:9.4
alias
:
db-postgres
entrypoint
:
[
"
/usr/local/bin/db-postgres"
]
command
:
[
"
start"
]
services
:
-
name
:
my-postgres:9.4
alias
:
db-postgres
entrypoint
:
[
"
/usr/local/bin/db-postgres"
]
command
:
[
"
start"
]
before_script
:
-
bundle install
before_script
:
-
bundle install
test
:
script
:
...
...
doc/ci/yaml/README.md
浏览文件 @
feae50ff
...
...
@@ -119,6 +119,35 @@ The following table lists available parameters for jobs:
NOTE:
**Note:**
Parameters
`types`
and
`type`
are
[
deprecated
](
#deprecated-parameters
)
.
## Setting default parameters
Some parameters can be set globally as the default for all jobs using the
`default:`
keyword. Default parameters can then be overridden by job-specific
configuration.
The following job parameters can be defined inside a
`default:`
block:
-
[
`image`
](
#image
)
-
[
`services`
](
#services
)
-
[
`before_script`
](
#before_script-and-after_script
)
-
[
`after_script`
](
#before_script-and-after_script
)
-
[
`cache`
](
#cache
)
In the following example, the
`ruby:2.5`
image is set as the default for all
jobs except the
`rspec 2.6`
job, which uses the
`ruby:2.6`
image:
```
yaml
default
:
image
:
ruby:2.5
rspec
:
script
:
bundle exec rspec
rspec 2.6
:
image
:
ruby:2.6
script
:
bundle exec rspec
```
## Parameter details
The following are detailed explanations for parameters used to configure CI/CD pipelines.
...
...
@@ -239,8 +268,9 @@ It's possible to overwrite the globally defined `before_script` and `after_scrip
if you set it per-job:
```
yaml
before_script
:
-
global before script
default
:
before_script
:
-
global before script
job
:
before_script
:
...
...
@@ -2550,18 +2580,39 @@ You can set it globally or per-job in the [`variables`](#variables) section.
The following parameters are deprecated.
### `types`
###
Globally-defined
`types`
CAUTION:
**Deprecated:**
`types`
is deprecated, and could be removed in a future release.
Use
[
`stages`
](
#stages
)
instead.
### `type`
###
Job-defined
`type`
CAUTION:
**Deprecated:**
`type`
is deprecated, and could be removed in one of the future releases.
Use
[
`stage`
](
#stage
)
instead.
### Globally-defined `image`, `services`, `cache`, `before_script`, `after_script`
Defining
`image`
,
`services`
,
`cache`
,
`before_script`
, and
`after_script`
globally is deprecated. Support could be removed
from a future release.
Use
[
`default:`
](
#setting-default-parameters
)
instead. For example:
```
yaml
default
:
image
:
ruby:2.5
services
:
-
docker:dind
cache
:
paths
:
[
vendor/
]
before_script
:
-
bundle install --path vendor/
after_script
:
-
rm -rf tmp/
```
## Custom build directories
> [Introduced](https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/1267) in Gitlab Runner 11.10
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录