628ea5306f
This configuration switches CLI to the new branch model. The branch is specified primarily in the repo list on dotnet-ci, then passed along to various utility functions. The configuration itself is read from the specified branch in the repo, and any PR's generated are branch specific. This means that changing the configuration in rel/1.0.0 will only affect the jobs that run against that branch
60 lines
No EOL
2 KiB
Groovy
60 lines
No EOL
2 KiB
Groovy
// 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.
|
|
|
|
// Import the utility functionality.
|
|
|
|
import jobs.generation.Utilities;
|
|
|
|
def project = GithubProject
|
|
def branch = GithubBranchName
|
|
|
|
def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'CentOS7.1']
|
|
|
|
def static getBuildJobName(def configuration, def os) {
|
|
return configuration.toLowerCase() + '_' + os.toLowerCase()
|
|
}
|
|
|
|
[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') {
|
|
buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}"
|
|
}
|
|
else {
|
|
buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}"
|
|
}
|
|
|
|
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
|
|
// Set the label.
|
|
steps {
|
|
if (os == 'Windows_NT') {
|
|
// Batch
|
|
batchFile(buildCommand)
|
|
}
|
|
else {
|
|
// Shell
|
|
shell(buildCommand)
|
|
}
|
|
}
|
|
}
|
|
|
|
Utilities.setMachineAffinity(newJob, os, 'latest-or-auto')
|
|
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
|
|
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml')
|
|
if (isPR) {
|
|
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${configuration} Build")
|
|
}
|
|
else {
|
|
Utilities.addGithubPushTrigger(newJob)
|
|
}
|
|
}
|
|
}
|
|
} |