Jenkins groovy post build action plugin issue -


following code find job in jenkins , job find required build , addsummary using groovy post build plugin.

def r = jenkins.model.jenkins.instance.getallitems().findall { it.name.contains("<myjob>") }  r.each { t ->   def builds = t.getbuilds()   builds.each{ b ->   if(b.displayname == '<myversion>'){     manager.createsummary("success.gif").appendtext("<h1>hello!!</h1>", false, false, false, "black")       }       b.save()     }   } 

its failing following error..

org.jenkinsci.plugins.scriptsecurity.sandbox.rejectedaccessexception: unclassified method java.lang.class createsummary java.lang.string     @ org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.sandboxinterceptor.onmethodcall(sandboxinterceptor.java:113) 

you need go jenkins -> manage jenkins -> in-process script approval.
(from jenkins script security plugin)

you able approve signature there.

see full example @ "jenkins groovy script approval"

https://cdn-images-1.medium.com/max/1600/1*rqvhikivuj5526fdnd15la.png


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -