-
Notifications
You must be signed in to change notification settings - Fork 229
/
Jenkinsfile
63 lines (57 loc) · 1.62 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
60
61
62
63
@Library('github.com/triologygmbh/jenkinsfile@6610cd92') _
pipeline {
agent {
docker {
image 'maven:3.5.0-jdk-8'
label 'docker' // Require a build executor with docker
}
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Build') {
steps {
createPipelineTriggers()
sh 'mvn clean install -DskipTests'
archiveArtifacts '**/target/*.*ar'
}
}
stage('Tests') {
parallel {
stage('Unit Test') {
steps {
sh 'mvn test'
}
}
stage('Integration Test') {
when { expression { return isTimeTriggeredBuild() } }
steps {
sh 'mvn verify -DskipUnitTests -Parq-wildfly-swarm '
}
}
}
}
}
post {
always {
// 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
}
}
}
void createPipelineTriggers() {
script {
def triggers = []
if (env.BRANCH_NAME == 'master') {
// Run a nightly only for master
triggers = [cron('H H(0-3) * * 1-5')]
}
properties([
pipelineTriggers(triggers)
])
}
}