2015-11-16 19:21:57 +00:00
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
2015-10-08 23:07:36 +00:00
|
|
|
// Import the utility functionality.
|
|
|
|
|
|
|
|
import jobs.generation.Utilities;
|
|
|
|
|
2015-12-03 16:37:04 +00:00
|
|
|
def project = GithubProject
|
2015-10-08 23:07:36 +00:00
|
|
|
|
2015-12-18 19:32:20 +00:00
|
|
|
def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'CentOS7.1']
|
2015-10-08 23:07:36 +00:00
|
|
|
|
2015-10-22 19:14:58 +00:00
|
|
|
def machineLabelMap = ['Ubuntu':'ubuntu-doc',
|
2015-10-21 18:24:23 +00:00
|
|
|
'OSX':'mac',
|
2015-12-18 19:32:20 +00:00
|
|
|
'Windows_NT':'windows',
|
|
|
|
'CentOS7.1' : 'centos-71']
|
2015-10-21 18:24:23 +00:00
|
|
|
|
|
|
|
def static getBuildJobName(def configuration, def os) {
|
|
|
|
return configuration.toLowerCase() + '_' + os.toLowerCase()
|
2015-10-08 23:07:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-03 16:57:28 +00:00
|
|
|
[true, false].each { isPR ->
|
|
|
|
['Debug', 'Release'].each { configuration ->
|
|
|
|
osList.each { os ->
|
|
|
|
// Calculate names
|
|
|
|
def lowerConfiguration = configuration.toLowerCase()
|
|
|
|
|
|
|
|
// Calculate job name
|
|
|
|
def jobName = getBuildJobName(configuration, os)
|
|
|
|
def buildCommand = '';
|
|
|
|
def postBuildCommand = '';
|
|
|
|
|
|
|
|
// Calculate the build command
|
|
|
|
if (os == 'Windows_NT') {
|
|
|
|
buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}"
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}"
|
2015-10-21 18:24:23 +00:00
|
|
|
}
|
2015-10-23 00:41:39 +00:00
|
|
|
|
2015-12-03 16:57:28 +00:00
|
|
|
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
|
|
|
|
// Set the label.
|
|
|
|
label(machineLabelMap[os])
|
|
|
|
steps {
|
|
|
|
if (os == 'Windows_NT') {
|
|
|
|
// Batch
|
|
|
|
batchFile(buildCommand)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Shell
|
|
|
|
shell(buildCommand)
|
|
|
|
|
|
|
|
// Post Build Cleanup
|
|
|
|
publishers {
|
|
|
|
postBuildScripts {
|
|
|
|
steps {
|
|
|
|
shell(postBuildCommand)
|
|
|
|
}
|
|
|
|
onlyIfBuildSucceeds(false)
|
2015-10-23 00:41:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 16:57:28 +00:00
|
|
|
}
|
2015-10-21 18:24:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-03 17:18:04 +00:00
|
|
|
Utilities.standardJobSetup(newJob, project, isPR)
|
2016-01-05 23:54:50 +00:00
|
|
|
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml')
|
2015-12-03 16:57:28 +00:00
|
|
|
if (isPR) {
|
|
|
|
Utilities.addGithubPRTrigger(newJob, "${os} ${configuration} Build")
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Utilities.addGithubPushTrigger(newJob)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|