Jenkinsfile: Yeah, let's not use deprecated code patterns.

This commit is contained in:
/dev/urandom 2016-09-13 03:03:35 +02:00
parent ee936a9a3a
commit 7c554962ed
No known key found for this signature in database
GPG Key ID: 41322B973E0F295E

34
Jenkinsfile vendored
View File

@ -100,21 +100,22 @@ def doUnitTests(name) {
} }
} }
// Change build name to correct version // First though let's give this build a proper name
stage "Versioning" stage "Checkout & Versioning" {
node("windows") { node("windows") {
checkout scm checkout scm
version = bat(returnStdout: true, script: 'premake5 version').split("\r?\n")[1] version = bat(returnStdout: true, script: 'premake5 version').split("\r?\n")[1]
currentBuild.setDisplayName "$version (#${env.BUILD_NUMBER})" currentBuild.setDisplayName "$version (#${env.BUILD_NUMBER})"
}
} }
// For each available configuration generate a normal build and a unit test build. // For each available configuration generate a normal build and a unit test build.
stage "Build" stage "Build" {
def executions = [:] def executions = [:]
for (int i = 0; i < configurations.size(); i++) for (int i = 0; i < configurations.size(); i++)
{ {
def configuration = configurations[i] def configuration = configurations[i]
executions["$configuration"] = { executions["$configuration"] = {
doBuild("IW4x $configuration", "", configuration) doBuild("IW4x $configuration", "", configuration)
@ -122,24 +123,26 @@ for (int i = 0; i < configurations.size(); i++)
executions["$configuration with unit tests"] = { executions["$configuration with unit tests"] = {
doBuild("IW4x $configuration (unit tests)", "--force-unit-tests", configuration) doBuild("IW4x $configuration (unit tests)", "--force-unit-tests", configuration)
} }
}
parallel executions
} }
parallel executions
// Run unit tests on each configuration. // Run unit tests on each configuration.
stage "Testing" stage "Testing" {
executions = [:] executions = [:]
for (int i = 0; i < configurations.size(); i++) for (int i = 0; i < configurations.size(); i++)
{ {
def configuration = configurations[i] def configuration = configurations[i]
executions["$configuration"] = { executions["$configuration"] = {
doUnitTests("IW4x $configuration with unit tests") doUnitTests("IW4x $configuration with unit tests")
} }
}
parallel executions
} }
parallel executions
// Collect all the binaries and give each configuration its own subfolder // Collect all the binaries and give each configuration its own subfolder
stage "Publishing" stage "Publishing" {
node("windows") { // any node will do node("windows") { // any node will do
for (int i = 0; i < configurations.size(); i++) for (int i = 0; i < configurations.size(); i++)
{ {
def configuration = configurations[i] def configuration = configurations[i]
@ -148,4 +151,5 @@ node("windows") { // any node will do
} }
} }
archiveArtifacts artifacts: "**/*.dll,**/*.pdb", fingerprint: true archiveArtifacts artifacts: "**/*.dll,**/*.pdb", fingerprint: true
}
} }