Skip to content

Commit 53f8974

Browse files
committed
[FIXED JENKINS-35402] Make it easier for update sites to tweak the InstallationJob
1 parent 405c86a commit 53f8974

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

core/src/main/java/hudson/model/UpdateSite.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,20 @@ public FormValidation doVerifySignature() throws IOException {
218218
return verifySignature(getJSONObject());
219219
}
220220

221+
/**
222+
* Extension point to allow implementations of {@link UpdateSite} to create a custom
223+
* {@link UpdateCenter.InstallationJob}.
224+
*
225+
* @param plugin the plugin to create the {@link UpdateCenter.InstallationJob} for.
226+
* @param uc the {@link UpdateCenter}.
227+
* @param dynamicLoad {@code true} if the plugin should be attempted to be dynamically loaded.
228+
* @return the {@link UpdateCenter.InstallationJob}.
229+
* @since 2.9
230+
*/
231+
protected UpdateCenter.InstallationJob createInstallationJob(Plugin plugin, UpdateCenter uc, boolean dynamicLoad) {
232+
return uc.new InstallationJob(plugin, this, Jenkins.getAuthentication(), dynamicLoad);
233+
}
234+
221235
/**
222236
* Verifies the signature in the update center data file.
223237
*/
@@ -872,7 +886,7 @@ public Future<UpdateCenterJob> deploy(boolean dynamicLoad, @CheckForNull UUID co
872886
return enableJob != null ? enableJob : uc.addJob(uc.new NoOpJob(UpdateSite.this, null, this));
873887
}
874888
}
875-
UpdateCenter.InstallationJob job = uc.new InstallationJob(this, UpdateSite.this, Jenkins.getAuthentication(), dynamicLoad);
889+
UpdateCenter.InstallationJob job = createInstallationJob(this, uc, dynamicLoad);
876890
job.setCorrelationId(correlationId);
877891
return uc.addJob(job);
878892
}

0 commit comments

Comments
 (0)