1

I am customizing the buildpipeline plugin to publish the SVN revision number for each job of each build number at pipeline. I found one hudson package `

hudson.scm.SubversionChangeLogSet.LogEntry,

which has the method getRevision() to get the last commit number. Is this the right package to get the revision number or any other packages need to be used to support this package ? How can I get the SVN revision through code ?

user1517716
  • 107
  • 2
  • 11

1 Answers1

0

We are using something like the following (which we learned from Cloudbees excellent support). Note that depending on whether your script is sandboxed or not you will have to make some security exceptions on the script security config page.

node {
    echo "Getting Changeset"
    build = currentBuild.rawBuild
    changeSet = build.changeSets
    changeSet.each { entry ->
            entry.each { cs ->
            revision = cs.getCommitId()
            author = cs.getAuthor()
            msg = cs.getMsgAnnotated()
            timestamp = cs.getTimestamp()
        }
    }
}
Ed Meagher
  • 151
  • 1
  • 3