diff -r 37f3dd667f71 -r f9f519bb10b6 pipeline.groovy --- a/pipeline.groovy Mon Aug 14 21:08:20 2017 +0100 +++ b/pipeline.groovy Tue Aug 15 10:44:12 2017 +0100 @@ -21,14 +21,13 @@ * ... * pipeline = load "pipeline.groovy" * ... - * pipeline.configurations = [ 'NODE': 'qnx', 'ARCH' : 'mips' ] + * pipeline.configurations = [ 'BUILD_TARGET': 'mips-sgi-irix' ] * ... * * Default value: see below. */ configurations = [ - 'NODE': ['windows' , 'linux' ], - 'ARCH': ['i386', 'x86_64' ] + 'BUILD_TARGET': ['i686-pc-mingw32' , 'x86_64-w64-mingw32', 'i686-pc-linux-gnu', 'x86_64-pc-linux-gnu' ] ] /** Branch to build. To overwrite do: @@ -68,7 +67,7 @@ def build() { stage ( "Build" ) { matrix ( configurations ) { - stage ( "Checkout - {${env.NODE}-${env.ARCH}} " ) { + stage ( "Checkout - {${env.BUILD_TARGET}} " ) { sshagent([ scm.getCredentialsId() ]) { sh """ if [ -f Jenkinsfile.rb ]; then @@ -78,19 +77,19 @@ fi hg up ${branch != null ? branch : scm.getBranch()} """ - sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --arch ${env.ARCH} update" + sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} update" } } - stage ( "Compile - {${env.NODE}-${env.ARCH}}") { - sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" compile" + stage ( "Compile - {${env.BUILD_TARGET}}") { + sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} compile" } } } stage ( "Test" ) { matrix ( configurations ) { - stage ( "Test - {${env.NODE}-${env.ARCH}}") { + stage ( "Test - {${env.BUILD_TARGET}}") { /* * Some tests requires display, so: * @@ -101,10 +100,10 @@ */ if ( isUnix() ) { wrap([$class: 'Xvfb', autoDisplayName: true, additionalOptions: '-screen 0 1024x768x24 -pixdepths 24 4 8 15 16 32', parallelBuild: true]) { - sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" test" + sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} test" } } else { - sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" test" + sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} test" } junit allowEmptyResults: true, testResults: "reports/*build${env.BUILD_NUMBER}*.xml" } @@ -182,14 +181,14 @@ for (i = 0; i < combinations.length; i++) { def index = i def conf = combinations[i]; - branches["${conf.NODE}-${conf.ARCH}"] = { - node ( conf.NODE ) { + branches["${conf.BUILD_TARGET}"] = { + node ( conf.BUILD_TARGET ) { def newEnv = [] for (k in conf.keySet()) { newEnv.add("${k}=${conf[k]}") } withEnv ( newEnv ) { - ws ("workspace/${workspace}/${env.ARCH}") { + ws ("workspace/${workspace}/${env.BUILD_TARGET}") { block() } } @@ -213,7 +212,7 @@ newEnv.add("${k}=${conf[k]}") } withEnv ( newEnv ) { - ws ("workspace/${workspace}/${env.ARCH}") { + ws ("workspace/${workspace}/${env.BUILD_TARGET}") { block() } } @@ -223,8 +222,8 @@ def artifacts() { matrix ( configurations ) { - stage ( "Artifacts - {${env.NODE}-${env.ARCH}}") { - sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" artifacts" + stage ( "Artifacts - {${env.BUILD_TARGET}}") { + sh "ruby Jenkinsfile.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} artifacts" archiveArtifacts artifacts: "artifacts/*build${env.BUILD_NUMBER}*.zip, artifacts/*build${env.BUILD_NUMBER}*.bz2, artifacts/*build${env.BUILD_NUMBER}*.sha256", fingerprint: true//, onlyIfSuccessful: true } }