forked from dotnet/machinelearning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
68 lines (56 loc) · 2.2 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
// Import the utility functionality.
import jobs.generation.ArchivalSettings;
import jobs.generation.Utilities;
def project = GithubProject
def branch = GithubBranchName
['Windows_NT', 'Linux', 'OSX10.13'].each { os ->
['Debug', 'Release'].each { config ->
[true, false].each { isPR ->
// Calculate job name
def jobName = os.toLowerCase() + '_' + config.toLowerCase()
def buildFile = '';
def machineAffinity = 'latest-or-auto'
// Calculate the build command
if (os == 'Windows_NT') {
buildFile = ".\\build.cmd"
} else {
buildFile = "./build.sh"
}
def buildCommand = buildFile + " -$config -runtests"
def packCommand = buildFile + " -buildPackages"
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
steps {
if (os == 'Windows_NT') {
batchFile(buildCommand)
batchFile(packCommand)
}
else {
// Shell
shell(buildCommand)
shell(packCommand)
}
}
}
def osImageName = os
if (os == 'Linux') {
// Trigger a portable Linux build that runs on RHEL7.2
osImageName = "RHEL7.2"
}
Utilities.setMachineAffinity(newJob, osImageName, machineAffinity)
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
if (isPR) {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "$os $config")
}
else {
Utilities.addGithubPushTrigger(newJob)
}
Utilities.addMSTestResults(newJob, 'bin/**/*.trx')
def archiveSettings = new ArchivalSettings()
archiveSettings.addFiles('bin/**/*')
archiveSettings.excludeFiles('bin/obj/**')
archiveSettings.setFailIfNothingArchived()
archiveSettings.setArchiveOnFailure()
Utilities.addArchival(newJob, archiveSettings)
}
}
}