提交 f1dfc720 编写于 作者: S Stephen Connolly

Merge pull request #2394 from stephenc/custome-installation-job

[FIXED JENKINS-35402] Make it easier for update sites to tweak the InstallationJob
......@@ -218,6 +218,20 @@ public class UpdateSite {
return verifySignature(getJSONObject());
}
/**
* Extension point to allow implementations of {@link UpdateSite} to create a custom
* {@link UpdateCenter.InstallationJob}.
*
* @param plugin the plugin to create the {@link UpdateCenter.InstallationJob} for.
* @param uc the {@link UpdateCenter}.
* @param dynamicLoad {@code true} if the plugin should be attempted to be dynamically loaded.
* @return the {@link UpdateCenter.InstallationJob}.
* @since 2.9
*/
protected UpdateCenter.InstallationJob createInstallationJob(Plugin plugin, UpdateCenter uc, boolean dynamicLoad) {
return uc.new InstallationJob(plugin, this, Jenkins.getAuthentication(), dynamicLoad);
}
/**
* Verifies the signature in the update center data file.
*/
......@@ -872,7 +886,7 @@ public class UpdateSite {
return enableJob != null ? enableJob : uc.addJob(uc.new NoOpJob(UpdateSite.this, null, this));
}
}
UpdateCenter.InstallationJob job = uc.new InstallationJob(this, UpdateSite.this, Jenkins.getAuthentication(), dynamicLoad);
UpdateCenter.InstallationJob job = createInstallationJob(this, uc, dynamicLoad);
job.setCorrelationId(correlationId);
return uc.addJob(job);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册