Skip to content

Instantly share code, notes, and snippets.

@daspecster
Forked from justincampbell/after.sh
Last active January 8, 2016 22:22
Show Gist options
  • Save daspecster/75d1e5b326938152533d to your computer and use it in GitHub Desktop.
Save daspecster/75d1e5b326938152533d to your computer and use it in GitHub Desktop.
Jenkins + GitHub Commit Status API
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/<user/org>/<my_repo>/statuses/$GIT_COMMIT?access_token=<token>" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"$STATUS\", \"context\": \"continuous-integration/jenkins\", \"description\": \"Jenkins\", \"target_url\": \"http://my.jenkins.box.com/job/dividata/$BUILD_NUMBER/console\"}"
curl "https://api.github.com/repos/<user/org>/<repo>/statuses/$GIT_COMMIT?access_token=<token>" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"pending\", \"context\": \"continuous-integration/jenkins\", \"description\": \"Jenkins\", \"target_url\": \"http://my.jenkins.box.com/job/dividata/$BUILD_NUMBER/console\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment