forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
74 lines (61 loc) · 2.36 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
70
71
72
73
74
// Import the utility functionality.
import jobs.generation.Utilities;
// Defines a the new of the repo, used elsewhere in the file
def project = GithubProject
// Generate the builds for branches: xplat, master and PRs (which aren't branch specific)
['*/master', '*/xplat', 'pr'].each { branch ->
['Windows_NT', 'OSX', 'Ubuntu'].each {osName ->
def isPR = false
def newJobName = ''
if (branch == 'pr') {
isPR = true
newJobName = Utilities.getFullJobName(project, "_${osName}", isPR)
} else {
newJobName = Utilities.getFullJobName(project, "innerloop_${branch.substring(2)}_${osName}", isPR)
}
// Create a new job with the specified name. The brace opens a new closure
// and calls made within that closure apply to the newly created job.
def newJob = job(newJobName) {
description('')
}
// Define job.
switch(osName) {
case 'Windows_NT':
newJob.with{
steps{
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" && RebuildWithLocalMSBuild.cmd")
}
}
// Add xunit result archiving
Utilities.addXUnitDotNETResults(newJob, 'bin/**/*_TestResults.xml')
break;
case 'OSX':
newJob.with{
steps{
shell("./cibuild.sh --scope Test")
}
}
// Add xunit result archiving
Utilities.addXUnitDotNETResults(newJob, 'bin/**/*_TestResults.xml')
break;
case 'Ubuntu':
newJob.with{
steps{
shell("./cibuild.sh --scope Compile")
}
}
//no test archiving yet
break;
}
Utilities.setMachineAffinity(newJob, osName)
Utilities.standardJobSetup(newJob, project, isPR, branch)
// Add archiving of logs
Utilities.addArchival(newJob, 'msbuild*.log')
// Add trigger
if (isPR) {
Utilities.addGithubPRTrigger(newJob, "${osName} Build")
} else {
Utilities.addGithubPushTrigger(newJob)
}
}
}