This question is a top search result on Google so I figure it's worth a late
reply.
readProperties returns a map and withEnv expects a list so you'll need to
convert it. Try something like:
> def map = readProperties file:'env.properties'
> def properties = map.collect { key, value -> return key+'='+value }
> withEnv(properties)
--
View this message in context:
http://jenkins-ci.361315.n4.nabble.com/Jenkins-Pipeline-How-can-I-pass-a-map-obtained-from-readProperties-to-withEnv-tp4861746p4900401.html
Sent from the Jenkins users mailing list archive at Nabble.com.
--
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/1499837625173-4900401.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.