Move CLI into the open
This commit is contained in:
parent
969413c7f1
commit
c97c9cab92
1 changed files with 47 additions and 64 deletions
111
netci.groovy
111
netci.groovy
|
@ -18,76 +18,59 @@ def static getBuildJobName(def configuration, def os) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
['Debug', 'Release'].each { configuration ->
|
[true, false].each { isPR ->
|
||||||
osList.each { os ->
|
['Debug', 'Release'].each { configuration ->
|
||||||
// Calculate names
|
osList.each { os ->
|
||||||
def lowerConfiguration = configuration.toLowerCase()
|
// Calculate names
|
||||||
|
def lowerConfiguration = configuration.toLowerCase()
|
||||||
|
|
||||||
// Calculate job name
|
// Calculate job name
|
||||||
def jobName = getBuildJobName(configuration, os)
|
def jobName = getBuildJobName(configuration, os)
|
||||||
def buildCommand = '';
|
def buildCommand = '';
|
||||||
def postBuildCommand = '';
|
def postBuildCommand = '';
|
||||||
|
|
||||||
// Calculate the build command
|
// Calculate the build command
|
||||||
if (os == 'Windows_NT') {
|
if (os == 'Windows_NT') {
|
||||||
buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}"
|
buildCommand = ".\\scripts\\ci_build.cmd ${lowerConfiguration}"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}"
|
buildCommand = "./scripts/ci_build.sh ${lowerConfiguration}"
|
||||||
}
|
|
||||||
|
|
||||||
// Create the new job
|
|
||||||
def newCommitJob = job(Utilities.getFullJobName(project, jobName, false)) {
|
|
||||||
// Set the label.
|
|
||||||
label(machineLabelMap[os])
|
|
||||||
steps {
|
|
||||||
if (os == 'Windows_NT') {
|
|
||||||
// Batch
|
|
||||||
batchFile(buildCommand)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Shell
|
|
||||||
shell(buildCommand)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Utilities.addScm(newCommitJob, project)
|
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
|
||||||
Utilities.addStandardOptions(newCommitJob)
|
// Set the label.
|
||||||
Utilities.addStandardNonPRParameters(newCommitJob)
|
label(machineLabelMap[os])
|
||||||
Utilities.addGithubPushTrigger(newCommitJob)
|
steps {
|
||||||
|
if (os == 'Windows_NT') {
|
||||||
|
// Batch
|
||||||
def newPRJob = job(Utilities.getFullJobName(project, jobName, true)) {
|
batchFile(buildCommand)
|
||||||
// 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Shell
|
||||||
|
shell(buildCommand)
|
||||||
|
|
||||||
|
// Post Build Cleanup
|
||||||
|
publishers {
|
||||||
|
postBuildScripts {
|
||||||
|
steps {
|
||||||
|
shell(postBuildCommand)
|
||||||
|
}
|
||||||
|
onlyIfBuildSucceeds(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Utilities.standardJobSetup(newJob, project, true)
|
||||||
|
if (isPR) {
|
||||||
|
Utilities.addGithubPRTrigger(newJob, "${os} ${configuration} Build")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Utilities.addGithubPushTrigger(newJob)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Utilities.addPrivatePRTestSCM(newPRJob, project)
|
|
||||||
Utilities.addStandardOptions(newPRJob)
|
|
||||||
Utilities.addStandardPRParameters(newPRJob, project)
|
|
||||||
Utilities.addGithubPRTrigger(newPRJob, "${os} ${configuration} Build")
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue