-
-
Save ryanlfoster/dc1be6a6ee5e846ea31c to your computer and use it in GitHub Desktop.
Revisions
-
gabro revised this gist
May 28, 2015 . 2 changed files with 11 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #!/bin/bash GITHUB_API=https://api.github.com AUTH_TOKEN= # GITHUB API TOKEN HERE REPO= # REPO NAME HERE URL=${bamboo.buildResultsUrl} SHA=${bamboo.repository.revision.number} PENDING_DESCRIPTION="The Bamboo CI build is in progress" GITHUB_STATUS_ENDPOINT=$GITHUB_API/repos/$REPO/statuses/$SHA curl -k -H "Authorization: token $AUTH_TOKEN" --request POST --data "{\"state\": \"pending\", \"description\": \"$PENDING_DESCRIPTION\", \"target_url\": \"$URL\"}" $GITHUB_STATUS_ENDPOINT > /dev/null -
gabro revised this gist
May 28, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ #!/bin/bash GITHUB_API=https://api.github.com AUTH_TOKEN= # GITHUB API TOKEN HERE REPO= # REPO NAME HERE URL=${bamboo.buildResultsUrl} SHA=${bamboo.repository.revision.number} SUCCESS_DESCRIPTION="The Bamboo CI build passed" -
gabro renamed this gist
May 28, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
gabro created this gist
May 28, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/bin/bash GITHUB_API=https://api.github.com AUTH_TOKEN=$APITOKEN # GITHUB API TOKEN HERE REPO=$REPO_NAME # REPO NAME HERE URL=${bamboo.buildResultsUrl} SHA=${bamboo.repository.revision.number} SUCCESS_DESCRIPTION="The Bamboo CI build passed" FAILURE_DESCRIPTION="Build #${bamboo.buildNumber} failed" # lol (mocha.json generated by mocha-bamboo-reporter) FAILED_TESTS=`grep -o '"failures": \d\+' mocha.json | cut -f2 -d" "` GITHUB_STATUS_ENDPOINT=$GITHUB_API/repos/$REPO/statuses/$SHA if [ $FAILED_TESTS == 0 ]; then curl -k -H "Authorization: token $AUTH_TOKEN" --request POST --data "{\"state\": \"success\", \"description\": \"$SUCCESS_DESCRIPTION\", \"target_url\": \"$URL\"}" $GITHUB_STATUS_ENDPOINT > /dev/null else curl -k -H "Authorization: token $AUTH_TOKEN" --request POST --data "{\"state\": \"failure\", \"description\": \"$FAILURE_DESCRIPTION\", \"target_url\": \"$URL\"}" $GITHUB_STATUS_ENDPOINT > /dev/null fi