forked from coreos/coreos-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cci.jenkinsfile
32 lines (27 loc) · 875 Bytes
/
.cci.jenkinsfile
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
// Documentation: https://github.com/coreos/coreos-ci/blob/master/README-upstream-ci.md
properties([
// abort previous runs when a PR is updated to save resources
disableConcurrentBuilds(abortPrevious: true)
])
node {
checkout scm
stage("Check Groovy") {
// hacky way to convert Jenkinsfiles into a "library" without executing it
shwrap("""
find . -type f -name '*.Jenkinsfile' -exec sed -i -e '1i\\return this' '{}' +
""")
def files = findFiles(glob: '**/*.groovy') + findFiles(glob: '**/*.Jenkinsfile')
def found_error = false
files.each {
try {
println("${it.path}")
load(it.path)
} catch (e) {
found_error = true
}
}
if (found_error) {
error "Syntax errors found"
}
}
}