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