forked from vivienfricadelamadeus/kubernetes-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
59 lines (57 loc) · 2.13 KB
/
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
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
properties([
disableConcurrentBuilds(abortPrevious: true),
durabilityHint('PERFORMANCE_OPTIMIZED'),
buildDiscarder(logRotator(numToKeepStr: '5')),
])
def splits
stage('Determine splits') {
node('maven-11') {
checkout scm
splits = splitTests parallelism: count(2), generateInclusions: true, estimateTestsFromFiles: true
}
}
stage('Tests') {
def branches = [:]
branches['failFast'] = true
for (int i = 0; i < splits.size(); i++) {
def num = i
def split = splits[num]
def index = num + 1
branches["kind-${index}"] = {
node('docker') {
timeout(90) {
checkout scm
try {
writeFile file: (split.includes ? "$WORKSPACE_TMP/includes.txt" : "$WORKSPACE_TMP/excludes.txt"), text: split.list.join("\n")
writeFile file: (split.includes ? "$WORKSPACE_TMP/excludes.txt" : "$WORKSPACE_TMP/includes.txt"), text: ''
sh './kind.sh -Dsurefire.includesFile="$WORKSPACE_TMP/includes.txt" -Dsurefire.excludesFile="$WORKSPACE_TMP/excludes.txt"'
dir(env.WORKSPACE_TMP) {
junit 'surefire-reports/*.xml'
}
} finally {
dir(env.WORKSPACE_TMP) {
if (fileExists('kindlogs/docker-info.txt')) {
archiveArtifacts 'kindlogs/'
}
}
}
}
}
}
}
branches['jdk11'] = {
retry(count: 3, conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()]) {
node('maven-11') {
timeout(60) {
checkout scm
sh 'mvn -B -ntp -Dset.changelist -Dmaven.test.failure.ignore clean install'
infra.prepareToPublishIncrementals()
junit 'target/surefire-reports/*.xml'
}
}
}
}
parallel branches
}
// Stage part of the library
infra.maybePublishIncrementals()