Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
0550f2a5
未验证
提交
0550f2a5
编辑于
8 years ago
作者:
Simon Welsh
浏览文件
操作
下载
补丁
差异文件
Add support for "skip ci" too
上级
2fc91c48
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
4
隐藏空白变更内容
行内
左右并排
显示
4 个更改的文件
CHANGELOG
+1
-1
1 个添加, 1 个删除
CHANGELOG
app/models/ci/pipeline.rb
+1
-1
1 个添加, 1 个删除
app/models/ci/pipeline.rb
doc/ci/yaml/README.md
+2
-2
2 个添加, 2 个删除
doc/ci/yaml/README.md
spec/services/create_commit_builds_service_spec.rb
+32
-1
32 个添加, 1 个删除
spec/services/create_commit_builds_service_spec.rb
有
36 个添加
和
5 个删除
CHANGELOG
+
1
−
1
浏览文件 @
0550f2a5
...
@@ -11,7 +11,7 @@ v 8.10.0 (unreleased)
...
@@ -11,7 +11,7 @@ v 8.10.0 (unreleased)
- Fix changing issue state columns in milestone view
- Fix changing issue state columns in milestone view
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- Add API endpoint for a group issues !4520 (mahcsig)
- Add API endpoint for a group issues !4520 (mahcsig)
- Allow [ci skip] to be in any case. !4785 (simon_w)
- Allow [ci skip] to be in any case
and allow [skip ci]
. !4785 (simon_w)
v 8.9.1
v 8.9.1
- Fix merge requests project settings help link anchor
- Fix merge requests project settings help link anchor
...
...
此差异已折叠。
点击以展开。
app/models/ci/pipeline.rb
+
1
−
1
浏览文件 @
0550f2a5
...
@@ -163,7 +163,7 @@ def ci_yaml_file
...
@@ -163,7 +163,7 @@ def ci_yaml_file
end
end
def
skip_ci?
def
skip_ci?
git_commit_message
=~
/
(
\[ci skip\]
)
/i
if
git_commit_message
git_commit_message
=~
/\[
(
ci skip
|skip ci)
\]/i
if
git_commit_message
end
end
def
environments
def
environments
...
...
此差异已折叠。
点击以展开。
doc/ci/yaml/README.md
+
2
−
2
浏览文件 @
0550f2a5
...
@@ -1034,8 +1034,8 @@ You can find the link under `/ci/lint` of your gitlab instance.
...
@@ -1034,8 +1034,8 @@ You can find the link under `/ci/lint` of your gitlab instance.
## Skipping builds
## Skipping builds
If your commit message contains
`[ci skip]`
, using any capitalization, the
If your commit message contains
`[ci skip]`
or
`[skip ci]`
, using any
commit will be created but the builds will be skipped.
capitalization, the
commit will be created but the builds will be skipped.
## Examples
## Examples
...
...
此差异已折叠。
点击以展开。
spec/services/create_commit_builds_service_spec.rb
+
32
−
1
浏览文件 @
0550f2a5
...
@@ -83,7 +83,9 @@
...
@@ -83,7 +83,9 @@
context
'when commit contains a [ci skip] directive'
do
context
'when commit contains a [ci skip] directive'
do
let
(
:message
)
{
"some message[ci skip]"
}
let
(
:message
)
{
"some message[ci skip]"
}
let
(
:messageFlip
)
{
"some message[skip ci]"
}
let
(
:capMessage
)
{
"some message[CI SKIP]"
}
let
(
:capMessage
)
{
"some message[CI SKIP]"
}
let
(
:capMessageFlip
)
{
"some message[SKIP CI]"
}
before
do
before
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:git_commit_message
)
{
message
}
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:git_commit_message
)
{
message
}
...
@@ -97,6 +99,21 @@
...
@@ -97,6 +99,21 @@
after:
'31das312'
,
after:
'31das312'
,
commits:
commits
commits:
commits
)
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
end
it
"skips builds creation if there is [skip ci] tag in commit message"
do
commits
=
[{
message:
messageFlip
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
...
@@ -116,7 +133,21 @@
...
@@ -116,7 +133,21 @@
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
end
end
it
"does not skips builds creation if there is no [ci skip] tag in commit message"
do
it
"skips builds creation if there is [SKIP CI] tag in commit message"
do
commits
=
[{
message:
capMessageFlip
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
end
it
"does not skips builds creation if there is no [ci skip] or [skip ci] tag in commit message"
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:git_commit_message
)
{
"some message"
}
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:git_commit_message
)
{
"some message"
}
commits
=
[{
message:
"some message"
}]
commits
=
[{
message:
"some message"
}]
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录