-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathnetci.groovy
42 lines (37 loc) · 1.72 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
// Groovy Script: http://www.groovy-lang.org/syntax.html
// Jenkins DSL: https://github.com/jenkinsci/job-dsl-plugin/wiki
import jobs.generation.ArchivalSettings
import jobs.generation.Utilities
def project = GithubProject
def branchName = GithubBranchName
// Generate jobs to build the latest head, and PRs
[true, false].each { isPr ->
// Build both debug and release
['Debug', 'Release'].each { configuration ->
def newJobName = Utilities.getFullJobName(project, "windows_${configuration.toLowerCase()}", isPr)
def newJob = job(newJobName) {
steps {
batchFile("""
SET VS150COMNTOOLS=%ProgramFiles(x86)%\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\
SET VSSDK150Install=%ProgramFiles(x86)%\\Microsoft Visual Studio\\2017\\Enterprise\\VSSDK\\
SET VSSDKInstall=%ProgramFiles(x86)%\\Microsoft Visual Studio\\2017\\Enterprise\\VSSDK\\
build.cmd /no-deploy-extension /${configuration.toLowerCase()} /no-node-reuse /trx-test-results
""")
}
}
def archiveSettings = new ArchivalSettings()
archiveSettings.addFiles("bin/**/*")
archiveSettings.excludeFiles("bin/obj/*")
archiveSettings.setFailIfNothingArchived()
archiveSettings.setArchiveOnFailure()
Utilities.addArchival(newJob, archiveSettings)
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto-dev15-0')
Utilities.addMSTestResults(newJob, "TestResults/*.trx")
Utilities.standardJobSetup(newJob, project, isPr, "*/$branchName")
if (isPr) {
Utilities.addGithubPRTriggerForBranch(newJob, branchName, "Windows ${configuration}")
} else {
Utilities.addGithubPushTrigger(newJob)
}
}
}