I have a simple question: How can I get the svn revision in a declarative jenkins pipeline. Similar to this post.
What I found out so far:
When you use a Freestyle job, simply use
${SVN_REVISION}
When you use a Scripted Pipeline, use the following command:
def scmVars = checkout([$class: 'SubversionSCM',...])
svnRevision = scmVars.SVN_REVISION
But how do I get the SVN Revision in a Declarative Pipeline? SVN_REVISION
is not defined, def
is not allowed in declarative pipelines and checkout scm
is only for multibranch pipelines.