mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 15:45:52 +00:00
[FIXED JENKINS-19081] Offer the option of downloading metadata directly from the server.
(cherry picked from commit 1ac77750e9)
Conflicts:
core/src/main/java/hudson/model/DownloadService.java
core/src/main/java/hudson/model/UpdateSite.java
This commit is contained in:
1 parent
90e989827e
commit
33d88c015c
13 files changed
+278
-62
No files matched your search
@@ -108,7 +108,12 @@ import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
import static hudson.init.InitMilestone.*;
|
||||
import hudson.model.DownloadService;
|
||||
import hudson.util.FormValidation;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import jenkins.security.DownloadSettings;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
|
||||
/**
|
||||
* Manages {@link PluginWrapper}s.
|
||||
@@ -775,6 +780,24 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
}
|
||||
}
|
||||
|
||||
@Restricted(NoExternalUse.class)
|
||||
@RequirePOST public HttpResponse doCheckUpdatesServer() throws IOException {
|
||||
for (UpdateSite site : Jenkins.getInstance().getUpdateCenter().getSites()) {
|
||||
FormValidation v = site.updateDirectlyNow(DownloadSettings.get().isCheckSignature());
|
||||
if (v.kind != FormValidation.Kind.OK) {
|
||||
// TODO crude but enough for now
|
||||
return v;
|
||||
}
|
||||
}
|
||||
for (DownloadService.Downloadable d : DownloadService.Downloadable.all()) {
|
||||
FormValidation v = d.updateNow();
|
||||
if (v.kind != FormValidation.Kind.OK) {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
return HttpResponses.forwardToPreviousPage();
|
||||
}
|
||||
|
||||
protected String identifyPluginShortName(File t) {
|
||||
try {
|
||||
JarFile j = new JarFile(t);
|
||||
|
||||
Reference in new issue
Block a user