summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2018-04-14 16:49:11 +0200
committerPatric Stout <truebrain@openttd.org>2018-04-14 20:19:59 +0200
commit43338b8a4572f3bc8c53338f0bff5afe9c225c8a (patch)
tree6e64d2f5fd7842252cd998825a72fd3d04cf303c /Jenkinsfile
parenta5382d8dd8e00a67e79f498b608cda7fd3c33654 (diff)
downloadopenttd-43338b8a4572f3bc8c53338f0bff5afe9c225c8a.tar.xz
Change: [JenkinsFile] allow easier configuration stages
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile41
1 files changed, 22 insertions, 19 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 0717b286c..095425a73 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,19 +1,24 @@
#!/usr/bin/env groovy
-def ci_checkers_targets = [
- ["commit-checker", "openttd/compile-farm-ci:commit-checker"],
-]
-def ci_builds_targets = [
- ["linux-amd64-clang-3.8", "openttd/compile-farm-ci:linux-amd64-clang-3.8"],
- ["linux-amd64-gcc-6", "openttd/compile-farm-ci:linux-amd64-gcc-6"],
- ["linux-i386-gcc-6", "openttd/compile-farm-ci:linux-i386-gcc-6"],
+// The stages we run one by one
+// Please don't add more than 2 items in a single stage; this hurts performance
+def ci_stages = [
+ "Checkers": [
+ "commit-checker": "openttd/compile-farm-ci:commit-checker",
+ ],
+ "Compilers": [
+ "linux-amd64-gcc-6": "openttd/compile-farm-ci:linux-amd64-gcc-6",
+ "linux-amd64-clang-3.8": "openttd/compile-farm-ci:linux-amd64-clang-3.8",
+ ],
+ "Archs": [
+ "linux-i386-gcc-6": "openttd/compile-farm-ci:linux-i386-gcc-6",
+ ],
]
-def ci_checkers_stages = ci_checkers_targets.collectEntries {
- ["${it[0]}" : generateCI(it[0], it[1])]
-}
-def ci_builds_stages = ci_builds_targets.collectEntries {
- ["${it[0]}" : generateCI(it[0], it[1])]
+def generateStage(targets) {
+ return targets.collectEntries{ key, target ->
+ ["${key}": generateCI(key, target)]
+ }
}
def generateCI(display_name, image_name) {
@@ -24,7 +29,7 @@ def generateCI(display_name, image_name) {
dir("${display_name}") {
unstash "source"
- docker.image("${image_name}").withRun("--volumes-from ${hostname} --workdir " + pwd()) { c->
+ docker.image("${image_name}").withRun("--volumes-from ${hostname} --workdir " + pwd()) { c ->
sh "docker logs --follow ${c.id}"
sh "exit `docker wait ${c.id}`"
}
@@ -50,12 +55,10 @@ node {
stash name: "source", useDefaultExcludes: false
}
- stage("Checkers") {
- parallel ci_checkers_stages
- }
-
- stage("Builds") {
- parallel ci_builds_stages
+ ci_stages.each { ci_stage ->
+ stage(ci_stage.key) {
+ parallel generateStage(ci_stage.value)
+ }
}
}
}