Skip to content

Commit

Permalink
Yet another @WithPlugins fix, working around JENKINS-19859 this time.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Sep 26, 2014
1 parent 0e5754c commit dae6a9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Expand Up @@ -168,9 +168,16 @@ public boolean installPlugins(final String... specs) {
if (status != InstallationStatus.UP_TO_DATE) {
try {
newPlugin.uploadTo(jenkins, injector, null);
new UpdateCenter(jenkins).waitForInstallationToComplete(name);
changed = true;
restartRequired |= status == InstallationStatus.OUTDATED;
try {
new UpdateCenter(jenkins).waitForInstallationToComplete(name);
} catch (InstallationFailedException x) {
if (!restartRequired) {
throw x;
}
// JENKINS-19859: else ignore; may be fine after the restart
}
} catch (IOException | ArtifactResolutionException e) {
throw new AssertionError("Failed to upload plugin: " + newPlugin, e);
}
Expand Down
Expand Up @@ -43,6 +43,10 @@ public boolean isInstalled(String pluginShortName) throws InstallationFailedExce
if (st.get("success").asBoolean()) {
return true; // successfully installed
}
JsonNode type = st.get("type");
if (type.asText().equals("Failure")) {
throw new InstallationFailedException("failed, see log");
}

return false; // still in progress
}
Expand Down

0 comments on commit dae6a9a

Please sign in to comment.