Skip to content

Instantly share code, notes, and snippets.

@pi-aej
Created December 11, 2015 03:16
Show Gist options
  • Save pi-aej/32f545d43d89d40a1905 to your computer and use it in GitHub Desktop.
Save pi-aej/32f545d43d89d40a1905 to your computer and use it in GitHub Desktop.
Get upstream build number from Jenkins
UPSTREAM=`curl "http://jenkins:8080/job/upstreamjob/lastBuild/api/xml?depth=1&xpath=/freeStyleBuild/number"`
NUMBER=`echo "$UPSTREAM" | sed "s/[^0-9]//g"`
wget http://jenkins:8080/job/upstreamjob/$NUMBER/artifact/workspace/VERSION -O VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment