groovy - Use value returned by a unix shell script then assign it to downstreamParameterized in Jenkins -


i have entry in our dsl.groovy

downstreamparameterized {   trigger('apache_server') {     parameters {       predefinedprop('app_package_version', "\${app_package_version}")     }   } } 

if notice, value coming app_package_version in stringparam. i'd happen use value being returned unix script(this script exists). how should write code in groovy?

job dsl uses groovy , groovy includes the execute method to string to make executing shells possible:

println "script.sh".execute().text 

you can learn more following article.

call execute() resolved during job dsl engine. therefore generated project have output value.

if call script each time job build, suggest using groovy plug-in.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -