2015-11-16 11:21:57 -08: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 16:07:36 -07:00
|
|
|
// Import the utility functionality.
|
|
|
|
|
|
|
|
import jobs.generation.Utilities;
|
|
|
|
|
2015-12-03 08:37:04 -08:00
|
|
|
def project = GithubProject
|
2016-02-12 09:11:20 -08:00
|
|
|
def branch = GithubBranchName
|
2015-10-08 16:07:36 -07:00
|
|
|
|
2015-12-18 11:32:20 -08:00
|
|
|
def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'CentOS7.1']
|
2015-10-08 16:07:36 -07:00
|
|
|
|
2015-10-21 11:24:23 -07:00
|
|
|
def static getBuildJobName(def configuration, def os) {
|
|
|
|
return configuration.toLowerCase() + '_' + os.toLowerCase()
|
2015-10-08 16:07:36 -07:00
|
|
|
}
|
|
|
|
|
2015-12-03 08:57:28 -08: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 = '';
|
|
|
|
|
|
|
|
// Calculate the build command
|
|
|
|
if (os == 'Windows_NT') {
|
2016-02-16 12:04:13 -08:00
|
|
|
buildCommand = ".\\build.cmd -Configuration ${lowerConfiguration} Default"
|
|
|
|
}
|
|
|
|
else if (os == 'Ubuntu') {
|
2016-02-16 12:37:47 -08:00
|
|
|
buildCommand = "./build.sh --skip-prereqs --configuration ${lowerConfiguration} --docker ubuntu Default"
|
2015-12-03 08:57:28 -08:00
|
|
|
}
|
|
|
|
else {
|
2016-02-16 12:04:13 -08:00
|
|
|
// Jenkins non-Ubuntu CI machines don't have docker
|
2016-02-16 12:37:47 -08:00
|
|
|
buildCommand = "./build.sh --skip-prereqs --configuration ${lowerConfiguration} Default"
|
2015-10-21 11:24:23 -07:00
|
|
|
}
|
2015-10-22 17:41:39 -07:00
|
|
|
|
2015-12-03 08:57:28 -08:00
|
|
|
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
|
|
|
|
// Set the label.
|
|
|
|
steps {
|
|
|
|
if (os == 'Windows_NT') {
|
|
|
|
// Batch
|
|
|
|
batchFile(buildCommand)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Shell
|
|
|
|
shell(buildCommand)
|
|
|
|
}
|
2015-10-21 11:24:23 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-08 16:17:00 -08:00
|
|
|
Utilities.setMachineAffinity(newJob, os, 'latest-or-auto')
|
2016-02-12 09:11:20 -08:00
|
|
|
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
|
2016-01-05 15:54:50 -08:00
|
|
|
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml')
|
2015-12-03 08:57:28 -08:00
|
|
|
if (isPR) {
|
2016-02-12 09:11:20 -08:00
|
|
|
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${configuration} Build")
|
2015-12-03 08:57:28 -08:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
Utilities.addGithubPushTrigger(newJob)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-02-16 12:04:13 -08:00
|
|
|
}
|