1
votes

is there a way in Jenkins to checkout the code of the last successful jenkins build?

For example: Jenkins build job #3 and checks out SVN-Revision 21; runs all tests and validates its correctness. Jenkins build job #4 and checks out SVN-Revision 22; runs all tests and finds some faults.

now i want to find the last successful build in jenkins (#3) and checkout the code from my SVN-Repository (Revision 21).

Is there a way to do so?

Thank you for your help...

1

1 Answers

1
votes

Use wget to grab the last successful build number and go from there, e.g.,

wget -qO- my_Jenkins_server/job/my_job/lastSuccessfulBuild/buildNumber