This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathnetci.groovy
79 lines (65 loc) · 3.41 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
75
76
77
78
79
// Import the utility functionality.
import jobs.generation.Utilities;
def project = GithubProject
def branch = GithubBranchName
def projectFolder = Utilities.getFolderName(project) + '/' + Utilities.getFolderName(branch)
// Windows + Linux build jobs
[true, false].each { isPR ->
['Ubuntu'].each { os ->
['Debug','Release'].each { configuration ->
// Global job vars.
def lowerConfigurationName = configuration.toLowerCase();
def linuxFlowJobName = "LinuxFlow_${os}_${lowerConfigurationName}"
// Setup a Windows job to build csproj-based components.
def winOS = 'Windows_NT';
def winBuildJobName = "${winOS.toLowerCase()}_${lowerConfigurationName}";
def newWinJob = job(Utilities.getFullJobName(project, winBuildJobName, isPR)) {
steps {
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat\" && CIBuild /${lowerConfigurationName}")
batchFile("C:\\Packer\\Packer.exe .\\LocalPackages.pack . LocalPackages")
}
}
Utilities.setMachineAffinity(newWinJob, winOS, 'latest-or-auto-elevated')
Utilities.standardJobSetup(newWinJob, project, isPR, "*/${branch}")
Utilities.addArchival(newWinJob, 'LocalPackages.pack')
Utilities.addArchival(newWinJob, 'msbuild.log', '', true, false)
// Setup a Linux job to build the Linux components.
def fullWinBuildJobName = projectFolder + '/' + newWinJob.name
def linuxBuildJobName = "${os.toLowerCase()}_${lowerConfigurationName}";
def newLinuxJob = job(Utilities.getFullJobName(project, linuxBuildJobName, isPR)) {
steps {
copyArtifacts(fullWinBuildJobName) {
includePatterns('*.pack')
buildSelector {
buildNumber('\${WIN_BUILD}')
}
}
shell("unpacker LocalPackages.pack .")
shell("./BuildCliComponents.sh ${lowerConfigurationName}")
}
parameters {
stringParam('WIN_BUILD', '', 'Build number to use for copying binaries for Linux build.')
}
}
Utilities.setMachineAffinity(newLinuxJob, os, 'latest-or-auto')
Utilities.standardJobSetup(newLinuxJob, project, isPR, "*/${branch}")
// Setup a flow job to orchestrate things.
def fullXunitPerformanceTestJobName = projectFolder + '/' + newLinuxJob.name
def newLinuxFlowJob = buildFlowJob(Utilities.getFullJobName(project, linuxFlowJobName, isPR)) {
buildFlow("""
b = build(params, "${fullWinBuildJobName}")
build(params +
[WIN_BUILD: b.build.number], "${fullXunitPerformanceTestJobName}")
""")
}
Utilities.setMachineAffinity(newLinuxFlowJob, os, 'latest-or-auto')
Utilities.standardJobSetup(newLinuxFlowJob, project, isPR, "*/${branch}")
if (isPR) {
Utilities.addGithubPRTriggerForBranch(newLinuxFlowJob, branch, "Windows / ${os} ${configuration} Build")
}
else {
Utilities.addGithubPushTrigger(newLinuxFlowJob)
}
}
}
}