Merge pull request #1386 from mmitche/switch-to-multibranch
Switch config to build the targeted branch
This commit is contained in:
commit
dbc9032202
1 changed files with 3 additions and 20 deletions
23
netci.groovy
23
netci.groovy
|
@ -6,19 +6,14 @@
|
||||||
import jobs.generation.Utilities;
|
import jobs.generation.Utilities;
|
||||||
|
|
||||||
def project = GithubProject
|
def project = GithubProject
|
||||||
|
def branch = GithubBranchName
|
||||||
|
|
||||||
def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'CentOS7.1']
|
def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'CentOS7.1']
|
||||||
|
|
||||||
def machineLabelMap = ['Ubuntu':'ubuntu-doc',
|
|
||||||
'OSX':'mac',
|
|
||||||
'Windows_NT':'windows',
|
|
||||||
'CentOS7.1' : 'centos-71']
|
|
||||||
|
|
||||||
def static getBuildJobName(def configuration, def os) {
|
def static getBuildJobName(def configuration, def os) {
|
||||||
return configuration.toLowerCase() + '_' + os.toLowerCase()
|
return configuration.toLowerCase() + '_' + os.toLowerCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[true, false].each { isPR ->
|
[true, false].each { isPR ->
|
||||||
['Debug', 'Release'].each { configuration ->
|
['Debug', 'Release'].each { configuration ->
|
||||||
osList.each { os ->
|
osList.each { os ->
|
||||||
|
@ -28,7 +23,6 @@ def static getBuildJobName(def configuration, def os) {
|
||||||
// Calculate job name
|
// Calculate job name
|
||||||
def jobName = getBuildJobName(configuration, os)
|
def jobName = getBuildJobName(configuration, os)
|
||||||
def buildCommand = '';
|
def buildCommand = '';
|
||||||
def postBuildCommand = '';
|
|
||||||
|
|
||||||
// Calculate the build command
|
// Calculate the build command
|
||||||
if (os == 'Windows_NT') {
|
if (os == 'Windows_NT') {
|
||||||
|
@ -48,26 +42,15 @@ def static getBuildJobName(def configuration, def os) {
|
||||||
else {
|
else {
|
||||||
// Shell
|
// Shell
|
||||||
shell(buildCommand)
|
shell(buildCommand)
|
||||||
|
|
||||||
// Post Build Cleanup
|
|
||||||
publishers {
|
|
||||||
postBuildScripts {
|
|
||||||
steps {
|
|
||||||
shell(postBuildCommand)
|
|
||||||
}
|
|
||||||
onlyIfBuildSucceeds(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Utilities.setMachineAffinity(newJob, os, 'latest-or-auto')
|
Utilities.setMachineAffinity(newJob, os, 'latest-or-auto')
|
||||||
Utilities.standardJobSetup(newJob, project, isPR)
|
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
|
||||||
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml')
|
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml')
|
||||||
if (isPR) {
|
if (isPR) {
|
||||||
Utilities.addGithubPRTrigger(newJob, "${os} ${configuration} Build")
|
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${configuration} Build")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Utilities.addGithubPushTrigger(newJob)
|
Utilities.addGithubPushTrigger(newJob)
|
||||||
|
|
Loading…
Reference in a new issue