Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2394 from stephenc/custome-installation-job
[FIXED JENKINS-35402] Make it easier for update sites to tweak the InstallationJob
  • Loading branch information
stephenc committed Jun 7, 2016
2 parents 9657629 + 53f8974 commit f1dfc72
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion core/src/main/java/hudson/model/UpdateSite.java
Expand Up @@ -218,6 +218,20 @@ public FormValidation doVerifySignature() throws IOException {
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.
*/
Expand Down Expand Up @@ -872,7 +886,7 @@ public Future<UpdateCenterJob> deploy(boolean dynamicLoad, @CheckForNull UUID co
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);
}
Expand Down

0 comments on commit f1dfc72

Please sign in to comment.