I have Jenkins 2.19.4 with Pipeline: Declarative Agent API 1.0.1. How to use readProperties if you cannot define a variable to assign properties that are readable?
For example, to capture the SVN version number, I am currently capturing it in the following scenario:
"" "
echo "SVN_REVISION=\$(svn info ${svnUrl}/projects | \ grep Revision | \ sed 's/Revision: //g')" > svnrev.txt
"" "
def svnProp = readProperties file: 'svnrev.txt'
Then I can access using:
${svnProp['SVN_REVISION']}
Since it is not legal to define svnProp in a declarative style, how is readProperties used?
jenkins jenkins-pipeline
P. Beatty
source share