blob: 735122f624413940cba74636d188bf0e9c6ea2a5 (
plain) (
blame)
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
|
// Jenkinsfile utilities
// Clone the source repository and examine the most recent commit message.
// If a '[ci skip]' or '[skip ci]' directive is present, immediately
// terminate the job with a success code.
// If no skip directive is found, stash all the source files for efficient retrieval
// by subsequent nodes.
def scm_checkout() {
skip_job = 0
node("on-master") {
stage("Setup") {
checkout(scm)
// Obtain the last commit message and examine it for skip directives.
logoutput = sh(script:"git log -1 --pretty=%B", returnStdout: true).trim()
if (logoutput.contains("[ci skip]") || logoutput.contains("[skip ci]")) {
skip_job = 1
currentBuild.result = 'SUCCESS'
println("\nBuild skipped due to commit message directive.\n")
// System.exit(0) // WARNING: FATAL to Jenkins
return skip_job
//throw new hudson.AbortException('Guess what!')
//throw new java.io.IOException('Guess what!')
}
sh(script: "ls -al")
stash includes: '**/*', name: 'source_tree'
}
}
return skip_job
}
def concurrent2(configs) {
def tasks = [:]
for (config in configs) {
println("concurrent2: build.nodetype = ${config.nodetype}")
tasks["${config.nodetype}/${config.build_mode}"] = {
node(config.nodetype) {
withEnv(config.env_vars) {
def prefix = pwd() + "/_install"
stage("Build (${config.build_mode})") {
unstash "source_tree"
sh "ls -al"
} //end stage
} //end withEnv
} // end node
}
} //end for
stage("Matrix") {
parallel(tasks)
}
} //end concurrent2
|