Created
April 6, 2016 18:34
-
-
Save DanPurdy/25fc1989d67a5c40d6ea6d18ea472330 to your computer and use it in GitHub Desktop.
Updates your github branch status from bamboo based on if your test phase was reached after building your app
This file contains hidden or 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
cd ${bamboo.build.working.directory} | |
if [ -d "test-reports" ] 1> /dev/null 2>&1; then | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "success", | |
"context": "Build", | |
"description": "Branch was tested successfully", | |
"target_url": "${bamboo.buildResultsUrl}" | |
}' \ | |
https://GITHUB-URL/api/v3/repos/GITHUB-USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null | |
else | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "failure", | |
"context": "Build", | |
"description": "There was an error testing the branch", | |
"target_url": "${bamboo.buildResultsUrl}" | |
}' \ | |
https://GITHUB-URL/api/v3/repos/GITHUB-USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment