Created
February 4, 2013 10:02
-
-
Save winks/4705941 to your computer and use it in GitHub Desktop.
git bisect for Jenkins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# git bisect job for jenkins, originally by @bashlog | |
GOOD_BUILD=$(curl 'http://jenkins.example.org:8080/job/BUILDNAME/lastStableBuild/api/json' | sed 's:[{},]:\n:g'|grep '"number":'|sed 's/.*://') | |
BAD_BUILD=$(($GOOD_BUILD + 1)) | |
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 2)) | |
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 3)) | |
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 4)) | |
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 5)) | |
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 6)) | |
GOOD_HASH=$(curl "http://jenkins.example.org:8080/job/BUILDNAME/$GOOD_BUILD/api/json" | sed 's:[{}]:\n:g'|grep '"SHA1".*name'|sed 's/"SHA1":"\([^"]*\)".*/\1/') | |
BAD_HASH=$(curl "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" | sed 's:[{}]:\n:g'|grep '"SHA1".*name'|sed 's/"SHA1":"\([^"]*\)".*/\1/') | |
CURRENT_HASH=$(git log --pretty=oneline|head -n1|sed 's: .*::') | |
git bisect start $BAD_HASH $GOOD_HASH | |
git bisect run ant autoloader phpunit-verbose compilejs | |
git checkout $CURRENT_HASH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment