-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathJenkinsfile
More file actions
73 lines (65 loc) · 1.89 KB
/
Copy pathJenkinsfile
File metadata and controls
73 lines (65 loc) · 1.89 KB
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
#!/usr/bin/env groovy
/* SPDX-License-Identifier: MIT-0 */
def is_downstream_build = false
def current_build_causes = currentBuild.getBuildCauses()
for (cause in current_build_causes) {
if (cause._class.toString().contains('UpstreamCause')) {
is_downstream_build = true
}
}
def props = []
props << parameters([
string(name: 'drakeSha', defaultValue: 'master',
description: 'Commit SHA or branch name. ' +
'Enter the full commit SHA or branch name of Drake to test. ' +
'Defaults to <code>master</code>.'),
])
if (env.BRANCH_NAME == 'main') {
def triggers = []
triggers << cron('H H(7-8) * * *')
props << pipelineTriggers(triggers)
}
properties(props)
def examples = [
'drake_bazel_external',
'drake_cmake_external',
'private/drake_cmake_external_static'
]
def jobs = [:]
for (example in examples) {
def name = example
jobs[name] = {
node('linux-noble-unprovisioned') {
timeout(600) {
ansiColor('xterm') {
try {
dir('src') {
stage('checkout') {
checkout scm
}
}
dir('src/' + name) {
stage(name + ' setup') {
sh ".github/setup --drake-commit-hash ${params.drakeSha}"
}
stage(name + ' build and test') {
sh ".github/ci_build_test --drake-commit-hash ${params.drakeSha}"
}
}
} catch (e) {
if (env.BRANCH_NAME == 'main' && !is_downstream_build) {
emailext (
subject: "Build failed in Jenkins: ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: "See <${env.BUILD_URL}display/redirect?page=changes>",
recipientProviders: [[$class: 'DevelopersRecipientProvider']],
to: '$DEFAULT_RECIPIENTS',
)
}
throw e
}
}
}
}
}
}
parallel jobs