From d4cdd5b4855f8469253d1616f7290862aceaba4d Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 7 Dec 2012 09:38:47 -0500 Subject: [PATCH] Make jenkins talk to the github status api --- jenkins/base.sh | 12 ++++++++++++ jenkins/test_edge.sh | 7 ++++++- jenkins/test_lms.sh | 10 +++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 jenkins/base.sh diff --git a/jenkins/base.sh b/jenkins/base.sh new file mode 100644 index 0000000000..c7175e6e52 --- /dev/null +++ b/jenkins/base.sh @@ -0,0 +1,12 @@ + +function github_status { + gcli status create mitx mitx $GIT_COMMIT \ + --params=$1 \ + target_url:$BUILD_URL \ + description:"Build #$BUILD_NUMBER is running" \ + -f csv +} + +function github_mark_failed_on_exit { + trap '[ $? == "0" ] || github_status state:failed' EXIT +} \ No newline at end of file diff --git a/jenkins/test_edge.sh b/jenkins/test_edge.sh index ccca91fc37..71405d663f 100755 --- a/jenkins/test_edge.sh +++ b/jenkins/test_edge.sh @@ -3,6 +3,9 @@ set -e set -x +github_mark_failed_on_exit +github_status state:pending + # Reset the submodule, in case it changed git submodule foreach 'git reset --hard HEAD' @@ -26,4 +29,6 @@ rake phantomjs_jasmine_cms || true rake coverage:xml coverage:html [ $TESTS_FAILED == '0' ] -rake autodeploy_properties \ No newline at end of file +rake autodeploy_properties + +github_status state:success diff --git a/jenkins/test_lms.sh b/jenkins/test_lms.sh index a7f8555f81..69fbf50dfa 100755 --- a/jenkins/test_lms.sh +++ b/jenkins/test_lms.sh @@ -3,6 +3,12 @@ set -e set -x +. base.sh + +github_mark_failed_on_exit +github_status state:pending + + # Reset the submodule, in case it changed git submodule foreach 'git reset --hard HEAD' @@ -24,4 +30,6 @@ rake phantomjs_jasmine_lms || true rake coverage:xml coverage:html [ $TESTS_FAILED == '0' ] -rake autodeploy_properties \ No newline at end of file +rake autodeploy_properties + +github_status state:success