Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
4ef6a643
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
4ef6a643
编写于
1月 23, 2013
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-16457] Bogus Jenkins.rawBuildsDir not adequately diagnosed.
上级
77b49f58
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
27 deletion
+36
-27
changelog.html
changelog.html
+3
-1
core/src/main/java/hudson/model/Run.java
core/src/main/java/hudson/model/Run.java
+15
-14
core/src/main/java/hudson/model/listeners/RunListener.java
core/src/main/java/hudson/model/listeners/RunListener.java
+3
-2
core/src/main/java/jenkins/model/Jenkins.java
core/src/main/java/jenkins/model/Jenkins.java
+15
-10
未找到文件。
changelog.html
浏览文件 @
4ef6a643
...
...
@@ -55,7 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div
id=
"trunk"
style=
"display:none"
>
<!--=TRUNK-BEGIN=-->
<ul
class=
image
>
<li
class=
>
<li
class=
bug
>
Bogus “Build Record Root Directory” inadequately diagnosed.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-16457"
>
issue 16457
</a>
)
</ul>
</div>
<!--=TRUNK-END=-->
...
...
core/src/main/java/hudson/model/Run.java
浏览文件 @
4ef6a643
...
...
@@ -104,7 +104,6 @@ import net.sf.json.JSONObject;
import
org.apache.commons.io.input.NullInputStream
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.jelly.XMLOutput
;
import
org.apache.tools.ant.taskdefs.email.Mailer
;
import
org.kohsuke.accmod.Restricted
;
import
org.kohsuke.accmod.restrictions.NoExternalUse
;
import
org.kohsuke.stapler.*
;
...
...
@@ -112,12 +111,15 @@ import org.kohsuke.stapler.export.Exported;
import
org.kohsuke.stapler.export.ExportedBean
;
import
com.thoughtworks.xstream.XStream
;
import
hudson.model.Run.RunExecution
;
import
java.io.ByteArrayInputStream
;
import
org.kohsuke.stapler.interceptor.RequirePOST
;
import
java.io.FileOutputStream
;
import
java.io.OutputStream
;
import
static
java
.
util
.
logging
.
Level
.*;
import
javax.annotation.Nonnull
;
/**
* A particular execution of {@link Job}.
...
...
@@ -1224,7 +1226,8 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
}
}
return
new
NullInputStream
(
0
);
String
message
=
"No such file: "
+
logFile
;
return
new
ByteArrayInputStream
(
charset
!=
null
?
message
.
getBytes
(
charset
)
:
message
.
getBytes
());
}
public
Reader
getLogReader
()
throws
IOException
{
...
...
@@ -1465,7 +1468,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
* Among other things, this is often a necessary pre-condition
* before invoking other builds that depend on this build.
*/
public
abstract
void
cleanUp
(
BuildListener
listener
)
throws
Exception
;
public
abstract
void
cleanUp
(
@Nonnull
BuildListener
listener
)
throws
Exception
;
public
RunT
getBuild
()
{
return
_this
();
...
...
@@ -1597,19 +1600,17 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
// see issue #980.
state
=
State
.
POST_PRODUCTION
;
try
{
job
.
cleanUp
(
listener
);
}
catch
(
Exception
e
)
{
handleFatalBuildProblem
(
listener
,
e
);
// too late to update the result now
}
RunListener
.
fireCompleted
(
this
,
listener
);
if
(
listener
!=
null
)
if
(
listener
!=
null
)
{
try
{
job
.
cleanUp
(
listener
);
}
catch
(
Exception
e
)
{
handleFatalBuildProblem
(
listener
,
e
);
// too late to update the result now
}
RunListener
.
fireCompleted
(
this
,
listener
);
listener
.
finished
(
result
);
if
(
listener
!=
null
)
listener
.
closeQuietly
();
}
try
{
save
();
...
...
core/src/main/java/hudson/model/listeners/RunListener.java
浏览文件 @
4ef6a643
...
...
@@ -47,6 +47,7 @@ import java.lang.reflect.ParameterizedType;
import
java.lang.reflect.Type
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
javax.annotation.Nonnull
;
/**
* Receives notifications about builds.
...
...
@@ -86,7 +87,7 @@ public abstract class RunListener<R extends Run> implements ExtensionPoint {
* which becomes a part of the "console output" of this build. But when this method runs,
* the build is considered completed, so its status cannot be changed anymore.
*/
public
void
onCompleted
(
R
r
,
TaskListener
listener
)
{}
public
void
onCompleted
(
R
r
,
@Nonnull
TaskListener
listener
)
{}
/**
* Called after a build is moved to the {@link Run.State#COMPLETED} state.
...
...
@@ -174,7 +175,7 @@ public abstract class RunListener<R extends Run> implements ExtensionPoint {
/**
* Fires the {@link #onCompleted(Run, TaskListener)} event.
*/
public
static
void
fireCompleted
(
Run
r
,
TaskListener
listener
)
{
public
static
void
fireCompleted
(
Run
r
,
@Nonnull
TaskListener
listener
)
{
for
(
RunListener
l
:
all
())
{
if
(
l
.
targetType
.
isInstance
(
r
))
try
{
...
...
core/src/main/java/jenkins/model/Jenkins.java
浏览文件 @
4ef6a643
...
...
@@ -94,7 +94,6 @@ import hudson.DNSMultiCast;
import
hudson.DescriptorExtensionList
;
import
hudson.Extension
;
import
hudson.ExtensionList
;
import
hudson.ExtensionPoint
;
import
hudson.FilePath
;
import
hudson.Functions
;
import
hudson.Launcher
;
...
...
@@ -111,7 +110,6 @@ import hudson.UDPBroadcastThread;
import
hudson.Util
;
import
static
hudson
.
Util
.
fixEmpty
;
import
static
hudson
.
Util
.
fixNull
;
import
hudson.WebAppMain
;
import
hudson.XmlFile
;
import
hudson.cli.CLICommand
;
import
hudson.cli.CliEntryPoint
;
...
...
@@ -135,7 +133,6 @@ import hudson.search.SearchItem;
import
hudson.security.ACL
;
import
hudson.security.AccessControlled
;
import
hudson.security.AuthorizationStrategy
;
import
hudson.security.BasicAuthenticationFilter
;
import
hudson.security.FederatedLoginService
;
import
hudson.security.FullControlOnceLoggedInAuthorizationStrategy
;
import
hudson.security.HudsonFilter
;
...
...
@@ -263,7 +260,6 @@ import java.net.URL;
import
java.nio.charset.Charset
;
import
java.security.SecureRandom
;
import
java.text.Collator
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
...
...
@@ -381,17 +377,15 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
private
ProjectNamingStrategy
projectNamingStrategy
=
DefaultProjectNamingStrategy
.
DEFAULT_NAMING_STRATEGY
;
/**
* Root directory for the workspaces. This value will be variable-expanded against
* job name and JENKINS_HOME.
*
* Root directory for the workspaces.
* This value will be variable-expanded as per {@link #expandVariablesForDirectory}.
* @see #getWorkspaceFor(TopLevelItem)
*/
private
String
workspaceDir
=
"${ITEM_ROOTDIR}/"
+
WORKSPACE_DIRNAME
;
/**
* Root directory for the workspaces. This value will be variable-expanded against
* job name and JENKINS_HOME.
*
* Root directory for the builds.
* This value will be variable-expanded as per {@link #expandVariablesForDirectory}.
* @see #getBuildDirFor(Job)
*/
private
String
buildsDir
=
"${ITEM_ROOTDIR}/builds"
;
...
...
@@ -1772,6 +1766,17 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
return
FormValidation
.
validateNonNegativeInteger
(
value
);
}
public
FormValidation
doCheckRawBuildsDir
(
@QueryParameter
String
value
)
{
if
(!
value
.
contains
(
"${"
))
{
File
d
=
new
File
(
value
);
if
(!
d
.
isDirectory
()
&&
(
d
.
getParentFile
()
==
null
||
!
d
.
getParentFile
().
canWrite
()))
{
return
FormValidation
.
error
(
value
+
" does not exist and probably cannot be created"
);
}
// XXX failure to use either ITEM_* variable might be an error too?
}
return
FormValidation
.
ok
();
// XXX assumes it will be OK after substitution, but can we be sure?
}
// to route /descriptor/FQCN/xxx to getDescriptor(FQCN).xxx
public
Object
getDynamic
(
String
token
)
{
return
Jenkins
.
getInstance
().
getDescriptor
(
token
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录