What are some techniques to avoid script approvals with a Jenkins workflow Groovy script? -


the following script jenkins workflow plugin:

def mapping = readfile 'a file' mapping.eachline {       def line = it.tokenize('|')       sh "${line[1]}" } 

requires script approvals:

staticmethod org.codehaus.groovy.runtime.defaultgroovymethods tokenize java.lang.string java.lang.string staticmethod org.codehaus.groovy.runtime.defaultgroovymethods eachline java.lang.string java.lang.string 

in order have script run build must attempted, manual approval must granted, , build must attempted again, , on.

for large scripts rather tedious process keep white listing methods.

is there subset of groovy methods not require script approval and/or white listing?

you need approve newly run methods come up.

the script security plugin ships methods whitelisted already. methods listed here have not made in yet. jenkins-25804 tracks desire whitelist routine computational methods default.

note if using groovy cps dsl scm script source, there intentionally no option disable sandbox mode, i.e., use whole-script approval mode. because administrator need approve whole script after every committed edit, no matter how trivial. contrast, groovy cps dsl source, every edit made administrator gets recorded approved without separate step.


Popular posts from this blog