summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2018-04-14 16:00:25 +0200
committerPatric Stout <truebrain@openttd.org>2018-04-14 20:19:59 +0200
commit2ec775b964eca4319aec369f4932ca28fece363e (patch)
treec71e8d3470bd9e824322261b677fb1d81b9fdd44 /Jenkinsfile
parentae5628e903b3fa7b302ea1cae3456625e889d0af (diff)
downloadopenttd-2ec775b964eca4319aec369f4932ca28fece363e.tar.xz
Add: [JenkinsFile] show CI status per entry on GitHub
This makes it easier (and faster) to spot what went wrong
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile20
1 files changed, 15 insertions, 5 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index dcba7ff70..a159cc9ec 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -16,13 +16,23 @@ def ci_builds_stages = ci_builds_targets.collectEntries {
def generateCI(display_name, image_name) {
return {
- dir("${display_name}") {
- unstash "source"
+ githubNotify context: 'openttd/' + display_name, description: 'This commit is being built', status: 'PENDING'
- docker.image("${image_name}").withRun("--volumes-from ${hostname} --workdir " + pwd()) { c->
- sh "docker logs --follow ${c.id}"
- sh "exit `docker wait ${c.id}`"
+ try {
+ dir("${display_name}") {
+ unstash "source"
+
+ docker.image("${image_name}").withRun("--volumes-from ${hostname} --workdir " + pwd()) { c->
+ sh "docker logs --follow ${c.id}"
+ sh "exit `docker wait ${c.id}`"
+ }
}
+
+ githubNotify context: 'openttd/' + display_name, description: 'The commit looks good', status: 'SUCCESS'
+ }
+ catch (error) {
+ githubNotify context: 'openttd/' + display_name, description: 'The commit cannot be built', status: 'FAILURE'
+ throw error
}
}
}