How to read properties file from Jenkins 2.0 pipeline script
I just fought with this yesterday and today. I wish the availability of this was easier to find.
Grab the 'Pipeline Utility Steps' plugin.
Use the readProperties step.
def props = readProperties file: 'dir/my.properties'
One word of warning - what I expected to be booleans in the properties files were treated as strings.
I tried out and below works perfectly fine:
test.properties
Monday=abcdef
Tuesday=kfgh
def props = readProperties file:'/var/lib/jenkins/jobs/abc/test.properties'
def Var1= props['Monday']
def Var2= props['Tuesday']
echo "Var1=${Var1}"
echo "Var2=${Var2}"