Skip to content

Commit

Permalink
Merge pull request #6339 from cgundogan/pr/jenkins_buildstate
Browse files Browse the repository at this point in the history
jenkins: use FAILURE instead of UNSTABLE for GitHub commit status
  • Loading branch information
smlng committed Jan 13, 2017
2 parents 72a3e7e + 5d46148 commit 6998d97
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,17 @@ stage("examples") {
abortOnError("examples failed")
}

def buildState = 'SUCCESS'

if (currentBuild.result == null) {
currentBuild.result = 'SUCCESS'
}
else if (currentBuild.result != 'SUCCESS') {
buildState = 'FAILURE'
}

/* set commit status in GitHub with url pointing to logs manually (necessary workaround for now) */
githubNotify context: 'Jenkins', description: "${currentBuild.result}", status: "${currentBuild.result}",targetUrl: "${env.BUILD_URL}artifact"
githubNotify context: 'Jenkins', description: "${currentBuild.result}", status: buildState, targetUrl: "${env.BUILD_URL}artifact"

/* create a job */
def make_build(label, board, desc, arg)
Expand Down Expand Up @@ -208,7 +213,7 @@ def abortPreviousBuilds()
def abortOnError(msg)
{
if ((currentBuild.result != null) && (currentBuild.result == 'FAILURE')) {
githubNotify context: 'Jenkins', description: "${currentBuild.result}", status: "${currentBuild.result}",targetUrl: "${env.BUILD_URL}artifact"
githubNotify context: 'Jenkins', description: "${currentBuild.result}", status: 'FAILURE', targetUrl: "${env.BUILD_URL}artifact"
error msg
}
}

0 comments on commit 6998d97

Please sign in to comment.