Skip to content

Instantly share code, notes, and snippets.

@cheinema
Created October 10, 2014 18:41
Show Gist options
  • Save cheinema/db643f35dfd33023cf66 to your computer and use it in GitHub Desktop.
Save cheinema/db643f35dfd33023cf66 to your computer and use it in GitHub Desktop.
// To be run with the Jenkins EnvInject plugin in the section
// "Prepare an environment for the run/Evaluated Groovy script" of the job configuration
def url = JOB_URL + 'lastStableBuild/api/json?tree=changeSet[revisions[revision]]'
def json = new groovy.json.JsonSlurper().parseText(url.toURL().text)
return ['LAST_SVN_REVISION': json.changeSet.revisions[0].revision]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment