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
|
2016-02-12 17:11:20 +00:00
|
|
|
def branch = GithubBranchName
|
2016-03-11 22:32:36 +00:00
|
|
|
def isPR = true
|
2015-10-08 23:07:36 +00:00
|
|
|
|
2016-03-24 18:42:49 +00:00
|
|
|
def platformList = ['Ubuntu:x64:Debug', 'Ubuntu:x64:Release', 'OSX:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug']
|
2015-10-08 23:07:36 +00:00
|
|
|
|
2016-03-11 22:32:36 +00:00
|
|
|
def static getBuildJobName(def configuration, def os, def architecture) {
|
|
|
|
return configuration.toLowerCase() + '_' + os.toLowerCase() + '_' + architecture.toLowerCase()
|
2015-10-08 23:07:36 +00:00
|
|
|
}
|
|
|
|
|
2015-12-03 16:57:28 +00:00
|
|
|
|
2016-03-11 22:32:36 +00:00
|
|
|
platformList.each { platform ->
|
|
|
|
// Calculate names
|
|
|
|
def (os, architecture, configuration) = platform.tokenize(':')
|
2015-12-03 16:57:28 +00:00
|
|
|
|
2016-03-11 22:32:36 +00:00
|
|
|
// Calculate job name
|
|
|
|
def jobName = getBuildJobName(configuration, os, architecture)
|
|
|
|
def buildCommand = '';
|
2015-10-23 00:41:39 +00:00
|
|
|
|
2016-03-11 22:32:36 +00:00
|
|
|
// Calculate the build command
|
|
|
|
if (os == 'Windows_NT') {
|
|
|
|
buildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -Targets Default"
|
|
|
|
}
|
|
|
|
else if (os == 'Windows_2016') {
|
|
|
|
buildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -RunInstallerTestsInDocker -Targets Default"
|
|
|
|
}
|
|
|
|
else if (os == 'Ubuntu') {
|
|
|
|
buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --docker ubuntu --targets Default"
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Jenkins non-Ubuntu CI machines don't have docker
|
|
|
|
buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --targets Default"
|
|
|
|
}
|
2015-10-21 18:24:23 +00:00
|
|
|
|
2016-03-11 22:32:36 +00:00
|
|
|
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
|
|
|
|
// Set the label.
|
|
|
|
steps {
|
|
|
|
if (os == 'Windows_NT' || os == 'Windows_2016') {
|
|
|
|
// Batch
|
|
|
|
batchFile(buildCommand)
|
2015-12-03 16:57:28 +00:00
|
|
|
}
|
|
|
|
else {
|
2016-03-11 22:32:36 +00:00
|
|
|
// Shell
|
|
|
|
shell(buildCommand)
|
2015-12-03 16:57:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-11 22:32:36 +00:00
|
|
|
|
|
|
|
Utilities.setMachineAffinity(newJob, os, 'latest-or-auto')
|
|
|
|
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
|
|
|
|
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml')
|
|
|
|
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${architecture} ${configuration} Build")
|
2016-02-16 20:04:13 +00:00
|
|
|
}
|
2016-03-11 22:32:36 +00:00
|
|
|
|
|
|
|
|