Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
5ecbbefb
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,发现更多精彩内容 >>
提交
5ecbbefb
编写于
5月 14, 2013
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FIXED JENKINS-16652] Use UpdateSite.Plugin.deploy from PluginManager.doUploadPlugin.
上级
8c53e2f3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
13 deletion
+22
-13
changelog.html
changelog.html
+3
-0
core/src/main/java/hudson/PluginManager.java
core/src/main/java/hudson/PluginManager.java
+11
-13
core/src/main/java/hudson/model/UpdateCenter.java
core/src/main/java/hudson/model/UpdateCenter.java
+8
-0
未找到文件。
changelog.html
浏览文件 @
5ecbbefb
...
...
@@ -58,6 +58,9 @@ Upcoming changes</a>
<li
class=
bug
>
NPE from
<code>
Run.getDynamic
</code>
.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-17935"
>
issue 17935
</a>
)
<li
class=
bug
>
Reworked Upload Plugin gesture to work more like installation from an update center, and in particular to support dynamic load.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-16652"
>
issue 16652
</a>
)
<li
class=
bug
>
Errors in
<code>
init.groovy
</code>
halted startup; changed to just log a warning.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-17933"
>
issue 17933
</a>
)
...
...
core/src/main/java/hudson/PluginManager.java
浏览文件 @
5ecbbefb
...
...
@@ -732,25 +732,23 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
}
// first copy into a temporary file name
File
t
=
File
.
createTempFile
(
"uploaded"
,
"jp_"
,
rootDir
);
fileItem
.
write
(
t
);
// rename all new plugins to *.jpi
File
t
=
File
.
createTempFile
(
"uploaded"
,
".jpi"
);
t
.
deleteOnExit
();
fileItem
.
write
(
t
);
fileItem
.
delete
();
final
String
baseName
=
identifyPluginShortName
(
t
);
// and move the temp file into a proper name
new
File
(
rootDir
,
baseName
+
".hpi"
).
delete
();
// don't keep confusing legacy *.hpi
new
File
(
rootDir
,
baseName
+
".jpi"
).
delete
();
// rename can fail if the file already exists
t
.
renameTo
(
new
File
(
rootDir
,
baseName
+
".jpi"
));
PluginWrapper
existing
=
getPlugin
(
baseName
);
if
(
existing
!=
null
&&
existing
.
isBundled
){
existing
.
doPin
();
}
pluginUploaded
=
true
;
return
new
HttpRedirect
(
"."
);
// Now create a dummy plugin that we can dynamically load (the InstallationJob will force a restart if one is needed):
JSONObject
cfg
=
new
JSONObject
().
element
(
"name"
,
baseName
).
element
(
"version"
,
"0"
).
// unused but mandatory
element
(
"url"
,
t
.
toURI
().
toString
()).
element
(
"dependencies"
,
new
JSONArray
());
new
UpdateSite
(
UpdateCenter
.
ID_UPLOAD
,
null
).
new
Plugin
(
UpdateCenter
.
ID_UPLOAD
,
cfg
).
deploy
(
true
);
return
new
HttpRedirect
(
"../updateCenter"
);
}
catch
(
IOException
e
)
{
throw
e
;
}
catch
(
Exception
e
)
{
// grrr. fileItem.write throws this
...
...
core/src/main/java/hudson/model/UpdateCenter.java
浏览文件 @
5ecbbefb
...
...
@@ -89,6 +89,8 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
javax.annotation.CheckForNull
;
import
org.acegisecurity.context.SecurityContextHolder
;
import
org.kohsuke.accmod.Restricted
;
import
org.kohsuke.accmod.restrictions.NoExternalUse
;
import
org.kohsuke.stapler.export.Exported
;
import
org.kohsuke.stapler.export.ExportedBean
;
import
org.kohsuke.stapler.interceptor.RequirePOST
;
...
...
@@ -119,6 +121,9 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
* @since 1.483
*/
public
static
final
String
ID_DEFAULT
=
"default"
;
@Restricted
(
NoExternalUse
.
class
)
public
static
final
String
ID_UPLOAD
=
"_upload"
;
/**
* {@link ExecutorService} that performs installation.
...
...
@@ -1012,6 +1017,9 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
}
public
void
run
()
{
if
(
ID_UPLOAD
.
equals
(
site
.
getId
()))
{
return
;
}
LOGGER
.
fine
(
"Doing a connectivity check"
);
try
{
String
connectionCheckUrl
=
site
.
getConnectionCheckUrl
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录