【问题标题】:Jenkins Plugins update email notificationJenkins 插件更新邮件通知
【发布时间】:2022-10-06 05:25:58
【问题描述】:

我需要一个脚本来获取需要更新的詹金斯插件列表,并每周发送有关它们的电子邮件通知。

    标签: jenkins plugins


    【解决方案1】:

    您可以使用以下脚本作为参考并构建管道以发送电子邮件。

    // This cript prints all the installed plugins and if there are updates, the latest version 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 pluginList = new ArrayList(Jenkins.instance.pluginManager.plugins)
    
    pluginList.sort { it.getShortName() }.each{ plugin -> 
        println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()} : ${plugin.hasUpdate() ? plugin.getUpdateInfo().version : 'No Update'}")
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-22
      • 1970-01-01
      • 1970-01-01
      • 2015-07-06
      • 2015-06-08
      • 2015-11-10
      • 2015-03-14
      相关资源
      最近更新 更多