forked from microsoft/ConcordExtensibilitySamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
38 lines (33 loc) · 1.54 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
// Import the utility functionality.
import jobs.generation.Utilities;
import jobs.generation.JobReport;
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
['Debug', 'Release'].each { configuration ->
// Determine the name for the new job. The first parameter is the project,
// the second parameter is the base name for the job, and the last parameter
// is a boolean indicating whether the job will be a PR job. If true, the
// suffix _prtest will be appended.
def newJobName = Utilities.getFullJobName(project, "windows_${configuration.toLowerCase()}", 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) {
steps {
batchFile("call build.cmd /p:Configuration=${configuration}")
}
}
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto')
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
// Archive only on commit builds.
if (isPR) {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "Windows ${configuration}")
}
else {
Utilities.addGithubPushTrigger(newJob)
}
}
}
// Generate the job report
JobReport.Report.generateJobReport(out)