Skip to content

Instantly share code, notes, and snippets.

View bruinsg's full-sized avatar

Peter Bruin bruinsg

View GitHub Profile
@bruinsg
bruinsg / keep-jenkins-plugins-uptodate.groovy
Created December 5, 2019 13:53 — forked from alecharp/keep-jenkins-plugins-uptodate.groovy
Simple groovy script to upgrade active plugins when new versions are available
jenkins.model.Jenkins.getInstance().getUpdateCenter().getSites().each { site ->
site.updateDirectlyNow(hudson.model.DownloadService.signatureCheck)
}
hudson.model.DownloadService.Downloadable.all().each { downloadable ->
downloadable.updateNow();
}
def plugins = jenkins.model.Jenkins.instance.pluginManager.activePlugins.findAll {
it -> it.hasUpdate()