Merge pull request #387 from mmitche/move-cli-open

Move cli open
This commit is contained in:
Matt Mitchell 2015-12-03 09:00:57 -08:00
commit 1a3bf01225

View file

@ -4,9 +4,8 @@
// Import the utility functionality. // Import the utility functionality.
import jobs.generation.Utilities; import jobs.generation.Utilities;
import jobs.generation.InternalUtilities;
def project = 'dotnet/cli' def project = GithubProject
def osList = ['Ubuntu', 'OSX', 'Windows_NT'] def osList = ['Ubuntu', 'OSX', 'Windows_NT']
@ -19,6 +18,7 @@ def static getBuildJobName(def configuration, def os) {
} }
[true, false].each { isPR ->
['Debug', 'Release'].each { configuration -> ['Debug', 'Release'].each { configuration ->
osList.each { os -> osList.each { os ->
// Calculate names // Calculate names
@ -37,30 +37,7 @@ def static getBuildJobName(def configuration, def os) {
buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}" buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}"
} }
// Create the new job def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
def newCommitJob = job(InternalUtilities.getFullJobName(project, jobName, false)) {
// Set the label.
label(machineLabelMap[os])
steps {
if (os == 'Windows_NT') {
// Batch
batchFile(buildCommand)
}
else {
// Shell
shell(buildCommand)
}
}
}
InternalUtilities.addPrivatePermissions(newCommitJob)
InternalUtilities.addPrivateScm(newCommitJob, project)
Utilities.addStandardOptions(newCommitJob)
Utilities.addStandardNonPRParameters(newCommitJob)
Utilities.addGithubPushTrigger(newCommitJob)
def newPRJob = job(InternalUtilities.getFullJobName(project, jobName, true)) {
// Set the label. // Set the label.
label(machineLabelMap[os]) label(machineLabelMap[os])
steps { steps {
@ -87,10 +64,13 @@ def static getBuildJobName(def configuration, def os) {
} }
InternalUtilities.addPrivatePermissions(newPRJob) Utilities.standardJobSetup(newJob, project, true)
InternalUtilities.addPrivatePRTestSCM(newPRJob, project) if (isPR) {
Utilities.addStandardOptions(newPRJob) Utilities.addGithubPRTrigger(newJob, "${os} ${configuration} Build")
Utilities.addStandardPRParameters(newPRJob, project) }
Utilities.addGithubPRTrigger(newPRJob, "${os} ${configuration} Build") else {
Utilities.addGithubPushTrigger(newJob)
}
}
} }
} }