Make jenkins talk to the github status api
This commit is contained in:
12
jenkins/base.sh
Normal file
12
jenkins/base.sh
Normal file
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
rake autodeploy_properties
|
||||
|
||||
github_status state:success
|
||||
|
||||
@@ -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
|
||||
rake autodeploy_properties
|
||||
|
||||
github_status state:success
|
||||
|
||||
Reference in New Issue
Block a user