我有Jenkins 2.19.4 with Pipeline:Declarative Agent API 1.0.1.如果你不能定义一个变量来分配读取的属性,那么如何使用readProperties?
例如,要捕获SVN修订版号,我目前使用以下脚本样式捕获它:
```
echo "SVN_REVISION=\$(svn info ${svnUrl}/projects | \
grep Revision | \
sed 's/Revision: //g')" > svnrev.txt
Run Code Online (Sandbox Code Playgroud)
```
def svnProp = readProperties file: 'svnrev.txt'
Run Code Online (Sandbox Code Playgroud)
然后我可以使用:
${svnProp['SVN_REVISION']}
Run Code Online (Sandbox Code Playgroud)
由于在声明式样式中def svnProp不合法,readProperties如何使用?