The following script for the 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 to have the script run successfully a build must be attempted, a manual approval must be granted, and then another build must be attempted again, and so on.
For large scripts it is a rather tedious process to keep white listing methods.
Is there a subset of groovy methods which do not require script approval and/or white listing?