-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathJenkinsfile
51 lines (42 loc) · 1.3 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
@Library('github.com/triologygmbh/jenkinsfile@6610cd92') _
node {
properties([
pipelineTriggers(createPipelineTriggers()),
disableConcurrentBuilds(),
buildDiscarder(logRotator(numToKeepStr: '10'))
])
catchError {
stage('Checkout') {
checkout scm
}
stage('Build') {
mvn 'clean install -DskipTests'
archiveArtifacts '**/target/*.*ar'
}
parallel(
unitTest: {
stage('Unit Test') {
mvn 'test'
}
},
integrationTest: {
stage('Integration Test') {
if (isTimeTriggeredBuild()) {
mvn 'verify -DskipUnitTests -Parq-wildfly-swarm '
}
}
}
)
}
// Archive Unit and integration test results, if any
junit allowEmptyResults: true,
testResults: '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/*.xml'
mailIfStatusChanged env.EMAIL_RECIPIENTS
}
def createPipelineTriggers() {
if (env.BRANCH_NAME == 'master') {
// Run a nightly only for master
return [cron('H H(0-3) * * 1-5')]
}
return []
}