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"
Comments
Post a Comment