commit
b6761894cc
3 changed files with 82 additions and 24 deletions
82
netci.groovy
82
netci.groovy
|
@ -4,34 +4,78 @@ import jobs.generation.Utilities;
|
||||||
import jobs.generation.InternalUtilities;
|
import jobs.generation.InternalUtilities;
|
||||||
|
|
||||||
def project = 'dotnet/cli'
|
def project = 'dotnet/cli'
|
||||||
// Define build strings
|
|
||||||
def debugBuildString = '''./build.sh'''
|
|
||||||
|
|
||||||
// Generate the builds for debug
|
def osList = ['Ubuntu', 'OSX', 'Windows_NT']
|
||||||
|
|
||||||
def linuxDebugJob = job(InternalUtilities.getFullJobName(project, 'linux_debug', false)) {
|
def machineLabelMap = ['Ubuntu':'ubuntu',
|
||||||
label('ubuntu')
|
'OSX':'mac',
|
||||||
|
'Windows_NT':'windows']
|
||||||
|
|
||||||
|
def static getBuildJobName(def configuration, def os) {
|
||||||
|
return configuration.toLowerCase() + '_' + os.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
['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}"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the new job
|
||||||
|
def newCommitJob = job(InternalUtilities.getFullJobName(project, jobName, false)) {
|
||||||
|
// Set the label.
|
||||||
|
label(machineLabelMap[os])
|
||||||
steps {
|
steps {
|
||||||
shell(debugBuildString)
|
if (os == 'Windows_NT') {
|
||||||
|
// Batch
|
||||||
|
batchFile(buildCommand)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Shell
|
||||||
|
shell(buildCommand)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InternalUtilities.addPrivatePermissions(linuxDebugJob)
|
InternalUtilities.addPrivatePermissions(newCommitJob)
|
||||||
InternalUtilities.addPrivateScm(linuxDebugJob, project)
|
InternalUtilities.addPrivateScm(newCommitJob, project)
|
||||||
Utilities.addStandardOptions(linuxDebugJob)
|
Utilities.addStandardOptions(newCommitJob)
|
||||||
Utilities.addStandardNonPRParameters(linuxDebugJob)
|
Utilities.addStandardNonPRParameters(newCommitJob)
|
||||||
Utilities.addGithubPushTrigger(linuxDebugJob)
|
Utilities.addGithubPushTrigger(newCommitJob)
|
||||||
|
|
||||||
|
|
||||||
def linuxDebugPRJob = job(InternalUtilities.getFullJobName(project, 'linux_debug', true)) {
|
def newPRJob = job(InternalUtilities.getFullJobName(project, jobName, true)) {
|
||||||
label('ubuntu')
|
// Set the label.
|
||||||
|
label(machineLabelMap[os])
|
||||||
steps {
|
steps {
|
||||||
shell(debugBuildString)
|
if (os == 'Windows_NT') {
|
||||||
|
// Batch
|
||||||
|
batchFile(buildCommand)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Shell
|
||||||
|
shell(buildCommand)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InternalUtilities.addPrivatePermissions(linuxDebugPRJob)
|
|
||||||
InternalUtilities.addPrivatePRTestSCM(linuxDebugPRJob, project)
|
InternalUtilities.addPrivatePermissions(newPRJob)
|
||||||
Utilities.addStandardOptions(linuxDebugPRJob)
|
InternalUtilities.addPrivatePRTestSCM(newPRJob, project)
|
||||||
Utilities.addStandardPRParameters(linuxDebugPRJob, project)
|
Utilities.addStandardOptions(newPRJob)
|
||||||
Utilities.addGithubPRTrigger(linuxDebugPRJob, 'Linux Debug Build')
|
Utilities.addStandardPRParameters(newPRJob, project)
|
||||||
|
Utilities.addGithubPRTrigger(newPRJob, "${os} ${configuration} Build")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
5
scripts/ci_build.cmd
Normal file
5
scripts/ci_build.cmd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
CALL %~dp0..\build.cmd %*
|
||||||
|
|
||||||
|
exit /b %errorlevel%
|
9
scripts/ci_build.sh
Executable file
9
scripts/ci_build.sh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
$SCRIPT_DIR/../build.sh $@
|
||||||
|
|
||||||
|
ret_code=$?
|
||||||
|
exit $ret_code
|
||||||
|
|
Loading…
Reference in a new issue