Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created August 13, 2013 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysb33r/6221409 to your computer and use it in GitHub Desktop.
Save ysb33r/6221409 to your computer and use it in GitHub Desktop.
Obtaining the SVN Tracking Plugin information from within a Jenkins Build Flow
// Assumuing that the build flow tracks another job's SVN revision
// Get the SVN URLs and revisions
def svn=build.getAction(hudson.scm.RevisionParameterAction.class)
svn.revisions.each {
println it.SVNURL
println it.revision
}
// Get the Build number of the job being tracked
def trackedJob=build.getAction(hudson.plugins.trackingsvn.TrackingSVNAction.class)
println trackedJob.trackedBuildNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment