Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
47fa9f33
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,发现更多精彩内容 >>
提交
47fa9f33
编写于
7月 18, 2016
作者:
G
Grzegorz Bizon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move job variables config entry to new CI config
上级
1bf9e347
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
18 deletion
+6
-18
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+0
-16
lib/gitlab/ci/config/node/job.rb
lib/gitlab/ci/config/node/job.rb
+5
-1
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+1
-1
未找到文件。
lib/ci/gitlab_ci_yaml_processor.rb
浏览文件 @
47fa9f33
...
@@ -106,7 +106,6 @@ module Ci
...
@@ -106,7 +106,6 @@ module Ci
validate_job_types!
(
name
,
job
)
validate_job_types!
(
name
,
job
)
validate_job_stage!
(
name
,
job
)
if
job
[
:stage
]
validate_job_stage!
(
name
,
job
)
if
job
[
:stage
]
validate_job_variables!
(
name
,
job
)
if
job
[
:variables
]
validate_job_artifacts!
(
name
,
job
)
if
job
[
:artifacts
]
validate_job_artifacts!
(
name
,
job
)
if
job
[
:artifacts
]
validate_job_dependencies!
(
name
,
job
)
if
job
[
:dependencies
]
validate_job_dependencies!
(
name
,
job
)
if
job
[
:dependencies
]
end
end
...
@@ -124,14 +123,6 @@ module Ci
...
@@ -124,14 +123,6 @@ module Ci
raise
ValidationError
,
"
#{
name
}
job: tags parameter should be an array of strings"
raise
ValidationError
,
"
#{
name
}
job: tags parameter should be an array of strings"
end
end
if
job
[
:only
]
&&
!
validate_array_of_strings_or_regexps
(
job
[
:only
])
raise
ValidationError
,
"
#{
name
}
job: only parameter should be an array of strings or regexps"
end
if
job
[
:except
]
&&
!
validate_array_of_strings_or_regexps
(
job
[
:except
])
raise
ValidationError
,
"
#{
name
}
job: except parameter should be an array of strings or regexps"
end
if
job
[
:allow_failure
]
&&
!
validate_boolean
(
job
[
:allow_failure
])
if
job
[
:allow_failure
]
&&
!
validate_boolean
(
job
[
:allow_failure
])
raise
ValidationError
,
"
#{
name
}
job: allow_failure parameter should be an boolean"
raise
ValidationError
,
"
#{
name
}
job: allow_failure parameter should be an boolean"
end
end
...
@@ -151,13 +142,6 @@ module Ci
...
@@ -151,13 +142,6 @@ module Ci
end
end
end
end
def
validate_job_variables!
(
name
,
job
)
unless
validate_variables
(
job
[
:variables
])
raise
ValidationError
,
"
#{
name
}
job: variables should be a map of key-value strings"
end
end
def
validate_job_artifacts!
(
name
,
job
)
def
validate_job_artifacts!
(
name
,
job
)
job
[
:artifacts
].
keys
.
each
do
|
key
|
job
[
:artifacts
].
keys
.
each
do
|
key
|
unless
ALLOWED_ARTIFACTS_KEYS
.
include?
key
unless
ALLOWED_ARTIFACTS_KEYS
.
include?
key
...
...
lib/gitlab/ci/config/node/job.rb
浏览文件 @
47fa9f33
...
@@ -44,8 +44,11 @@ module Gitlab
...
@@ -44,8 +44,11 @@ module Gitlab
node
:except
,
While
,
node
:except
,
While
,
description:
'Refs policy this job will be executed for.'
description:
'Refs policy this job will be executed for.'
node
:variables
,
Variables
,
description:
'Environment variables available for this job.'
helpers
:before_script
,
:script
,
:stage
,
:type
,
:after_script
,
helpers
:before_script
,
:script
,
:stage
,
:type
,
:after_script
,
:cache
,
:image
,
:services
,
:only
,
:except
:cache
,
:image
,
:services
,
:only
,
:except
,
:variables
def
name
def
name
@metadata
[
:name
]
@metadata
[
:name
]
...
@@ -67,6 +70,7 @@ module Gitlab
...
@@ -67,6 +70,7 @@ module Gitlab
cache:
cache
,
cache:
cache
,
only:
only
,
only:
only
,
except:
except
,
except:
except
,
variables:
variables_defined?
?
variables
:
nil
,
after_script:
after_script
}
after_script:
after_script
}
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
浏览文件 @
47fa9f33
...
@@ -534,7 +534,7 @@ module Ci
...
@@ -534,7 +534,7 @@ module Ci
expect
{
GitlabCiYamlProcessor
.
new
(
config
,
path
)
}
expect
{
GitlabCiYamlProcessor
.
new
(
config
,
path
)
}
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
/job
: variables should be a map
/
)
/job
s:rspec:variables config should be a hash of key value pairs
/
)
end
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录