Is it possible to pass groovy scripts to a pipeline job
I want to be able to configure custom groovy scripts based on options
selected by my users.
I could have a massive script with many "if" clauses.
It would be nicer to create a groovy script based on selected options.
this api would then be testable internally.
I have tried a few tests run but it does not appear that the groovy being
passed is being executed.
groovy_script = "stage('testing') {\n build job: 'echo'\n}\n"
parameters: [string(name: 'groovy_script', value: groovy_script)
jenkins pipeline job
"""
#!groovy
import hudson.model.*
groovy_script
"""
I was hoping this would evaluate to
"""
#!groovy
import hudson.model.*
stage('testing') {
build job: 'echo'
}
"""
any ideas?
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/455449e1-2e5a-4f3a-9930-86472916b27c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.