forked from dotnet/dotnet-docker-nightly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
27 lines (23 loc) · 942 Bytes
/
netci.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import jobs.generation.Utilities
def project = GithubProject
def branch = GithubBranchName
def isPR = true
def platformList = ['Ubuntu16.04:Debian', 'Windows_2016:NanoServer']
platformList.each { platform ->
def(hostOS, containerOS) = platform.tokenize(':')
def newJobName = Utilities.getFullJobName(project, containerOS, isPR)
def machineLabel = (hostOS == 'Windows_2016') ? 'latest-containers' : 'latest-or-auto-docker'
def newJob = job(newJobName) {
steps {
if (hostOS == 'Windows_2016') {
batchFile("powershell -NoProfile -Command .\\build-and-test.ps1 -Platform win")
}
else {
shell("./build-and-test.sh")
}
}
}
Utilities.setMachineAffinity(newJob, hostOS, machineLabel)
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
Utilities.addGithubPRTriggerForBranch(newJob, branch, containerOS)
}