Skip to content

Instantly share code, notes, and snippets.

@brookslyrette
Forked from pcreux/complete.sh
Last active August 29, 2015 14:13
Show Gist options
  • Save brookslyrette/7b36863606800c158d01 to your computer and use it in GitHub Desktop.
Save brookslyrette/7b36863606800c158d01 to your computer and use it in GitHub Desktop.
# specs and cukes results are stored in JUnit format under test-reports
if (grep 'Failures: [^0]' surefire-reports/* || grep 'Errors: [^0]' surefire-reports/*); then
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "failure", "description": "Build Failed!", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null
else
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "success", "description": "Build Passed", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null
fi
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "pending", "description": "Build is running", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment