Using environment variable SVN_REVISION_n in a workflow build

143 views
Skip to first unread message

Peter Marcoen

unread,
Oct 7, 2015, 11:54:49 AM10/7/15
to Jenkins Users
In my previous freestyle projects after checking out from multiple repositories I could use the environment variable ${SVN_REVISION_1} to get the revision number of the first repository.

If, however, I use the following groovy script in a workflow job, I get "null" back.
Am I doing something wrong here?

node('unix') {
checkout([$class: 'SubversionSCM', locations: [[local: 'dir1', remote: 'http://subversion.xxx.com/svn/xxx/trunk']]])
checkout([$class: 'SubversionSCM', locations: [[local: 'dir2', remote: 'http://subversion.xxx.com/svn/yyy/trunk']]])
sh "echo ${env.SVN_REVISION}" sh "echo ${env.SVN_REVISION_1}"
}

Jesse Glick

unread,
Oct 9, 2015, 9:03:19 AM10/9/15
to Jenkins Users
On Wednesday, October 7, 2015 at 11:54:49 AM UTC-4, Peter Marcoen wrote:
Am I doing something wrong here?

No, just JENKINS-24141. The workaround is to get the revision number yourself. 
Reply all
Reply to author
Forward
0 new messages