forked from spring-projects/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
28 lines (28 loc) · 1.18 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
pipeline {
agent { label 'linux' }
environment {
DCOVER_URL = credentials('DCOVER_URL')
DCOVER_LICENSE_KEY = credentials('DCOVER_LICENSE_KEY')
DCOVER = 'dcover/dcover'
}
stages {
stage('Use dcover create in Jenkins') {
steps {
sh label: 'Get and unzip dcover jars into directory dcover, store dcover script location for later use',
script: '''
mkdir -p dcover
wget --quiet "$DCOVER_URL" --output-document "$DCOVER.zip"
unzip -qo "$DCOVER.zip" -d dcover
'''
sh label: 'Activate dcover',
script: '"$DCOVER" activate "$DCOVER_LICENSE_KEY"'
sh label: 'Build project',
script: 'mvn --batch-mode --no-transfer-progress compile'
sh label: 'Run dcover create',
script: '"$DCOVER" create --batch --maven org.springframework.samples.petclinic.system.CrashController'
sh label: 'Run tests - incorporating any tests from dcover',
script: 'mvn --batch-mode --no-transfer-progress prepare-package'
}
}
}
}