Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
jenkins
提交
96c08fa7
J
jenkins
项目概览
野花太放肆
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
96c08fa7
编写于
9月 17, 2013
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:jenkinsci/jenkins
上级
53ce4f0f
bf3d0805
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
3 deletion
+28
-3
core/src/main/java/jenkins/model/ProjectNamingStrategy.java
core/src/main/java/jenkins/model/ProjectNamingStrategy.java
+18
-3
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/config.groovy
...NamingStrategy/PatternProjectNamingStrategy/config.groovy
+5
-0
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/config.properties
...ngStrategy/PatternProjectNamingStrategy/config.properties
+1
-0
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/help-description.html
...rategy/PatternProjectNamingStrategy/help-description.html
+4
-0
未找到文件。
core/src/main/java/jenkins/model/ProjectNamingStrategy.java
浏览文件 @
96c08fa7
...
...
@@ -30,6 +30,7 @@ import hudson.Util;
import
hudson.model.Describable
;
import
hudson.model.Descriptor
;
import
hudson.model.Failure
;
import
jenkins.model.Messages
;
import
hudson.util.FormValidation
;
import
java.io.IOException
;
...
...
@@ -132,19 +133,29 @@ public abstract class ProjectNamingStrategy implements Describable<ProjectNaming
*/
private
final
String
namePattern
;
private
final
String
description
;
private
boolean
forceExistingJobs
;
@D
ataBoundConstructor
@D
eprecated
public
PatternProjectNamingStrategy
(
String
namePattern
,
boolean
forceExistingJobs
)
{
this
(
namePattern
,
null
,
forceExistingJobs
);
}
@DataBoundConstructor
public
PatternProjectNamingStrategy
(
String
namePattern
,
String
description
,
boolean
forceExistingJobs
)
{
this
.
namePattern
=
namePattern
;
this
.
description
=
description
;
this
.
forceExistingJobs
=
forceExistingJobs
;
}
@Override
public
void
checkName
(
String
name
)
throws
Failure
{
public
void
checkName
(
String
name
)
{
if
(
StringUtils
.
isNotBlank
(
namePattern
)
&&
StringUtils
.
isNotBlank
(
name
))
{
if
(!
Pattern
.
matches
(
namePattern
,
name
))
{
throw
new
Failure
(
jenkins
.
model
.
Messages
.
_Hudson_JobNameConventionNotApplyed
(
name
,
namePattern
).
toString
());
throw
new
Failure
(
StringUtils
.
isEmpty
(
description
)
?
Messages
.
Hudson_JobNameConventionNotApplyed
(
name
,
namePattern
)
:
description
);
}
}
}
...
...
@@ -153,6 +164,10 @@ public abstract class ProjectNamingStrategy implements Describable<ProjectNaming
return
namePattern
;
}
public
String
getDescription
()
{
return
description
;
}
public
boolean
isForceExistingJobs
()
{
return
forceExistingJobs
;
}
...
...
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/config.groovy
浏览文件 @
96c08fa7
...
...
@@ -6,6 +6,11 @@ def f=namespace(lib.FormTagLib)
f
.
entry
(
title:
_
(
"namePattern"
),
field:
"namePattern"
)
{
f
.
textbox
(
value:
h
.
defaulted
(
instance
?.
namePattern
,
descriptor
.
DEFAULT_PATTERN
),
class
:"
fixed
-
width
"
)
}
f
.
entry
(
title:
_
(
"description"
),
field:
"description"
)
{
f
.
textbox
()
}
f
.
entry
(
title:
_
(
"forceExistingJobs"
),
field:
"forceExistingJobs"
)
{
f
.
checkbox
(
name:
"forceExistingJobs"
)
}
...
...
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/config.properties
浏览文件 @
96c08fa7
...
...
@@ -21,6 +21,7 @@
# THE SOFTWARE.
namePattern
=
Name Pattern
description
=
Description
forceExistingJobs
=
force existing
core/src/main/resources/jenkins/model/ProjectNamingStrategy/PatternProjectNamingStrategy/help-description.html
0 → 100644
浏览文件 @
96c08fa7
<p>
Provide a human-readable description to explain naming constraints.
Will be used as error message when job name does not match pattern
</p>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录