forked from microsoft/vstest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
69 lines (58 loc) · 2.81 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Import the utility functionality.
import jobs.generation.Utilities;
// Defines a the new of the repo, used elsewhere in the file
def project = GithubProject
def branch = GithubBranchName
// Generate the builds for debug and release, commit and PRJob
[true, false].each { isPR -> // Defines a closure over true and false, value assigned to isPR
['Windows_NT', 'Ubuntu14.04'].each { osName ->
['Debug', 'Release'].each { configuration ->
// Determine the name for the new job. A _prtest suffix is appended if isPR is true.
def newJobName = Utilities.getFullJobName(project, "${osName}_${configuration}", isPR)
def newJob = job(newJobName) {
description("")
}
switch (osName) {
case "Windows_NT":
// Define your build/test strings here.
def buildString = """call build.cmd -c ${configuration}"""
def testString = """call test.cmd -c ${configuration}"""
def platformtestString = """call test.cmd -c ${configuration} -p platformtests"""
def smoketestString = """call test.cmd -c ${configuration} -p smoke"""
def acceptancetestString = """call test.cmd -c ${configuration} -p AcceptanceTests -v -f net451"""
// Create a new job for windows build
newJob.with {
steps {
batchFile(buildString)
batchFile(testString)
batchFile(platformtestString)
batchFile(smoketestString)
batchFile(acceptancetestString)
}
}
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto')
break;
case "Ubuntu14.04":
// Define your build/test strings here.
def buildString = """./build.sh -c ${configuration}"""
// TODO add test scripts
// Create a new job for windows build
newJob.with {
steps {
shell(buildString)
}
}
Utilities.setMachineAffinity(newJob, osName, 'latest-or-auto')
break;
}
// This call performs remaining common job setup on the newly created job.
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
if (isPR) {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${osName} / ${configuration} Build")
}
else {
Utilities.addGithubPushTrigger(newJob)
}
}
}
}