-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
91 lines (78 loc) · 2.4 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'mkdir silverstripe-cache'
sh 'composer require --prefer-dist --no-update silverstripe-themes/simple:~3.2'
sh 'composer update --no-suggest --prefer-dist'
}
}
stage('PHPUnit') {
steps {
sh 'vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --log-junit=build/logs/junit.xml --coverage-xml=build/logs/coverage'
}
}
stage("Publish Clover") {
steps {
step([$class: 'CloverPublisher', cloverReportDir: 'build/logs', cloverReportFileName: 'clover.xml'])
}
}
stage('Checkstyle Report') {
steps {
sh 'vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=phpcs.xml.dist --extensions=php,inc --ignore=autoload.php --ignore=vendor/ src/ tests/'
}
}
stage('Mess Detection Report') {
steps {
sh 'vendor/bin/phpmd src xml codesize,unusedcode,naming --reportfile build/logs/pmd.xml --exclude vendor/ --exclude autoload.php || exit 0'
}
}
stage('CPD Report') {
steps {
sh 'vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml --exclude vendor src/ tests/ || exit 0'
}
}
stage('Lines of Code') {
steps {
sh 'vendor/bin/phploc --count-tests --exclude vendor/ --log-csv build/logs/phploc.csv --log-xml build/logs/phploc.xml src/ tests/'
}
}
stage('Software metrics') {
steps {
sh 'mkdir build/pdepend'
sh 'vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg --ignore=vendor src'
}
}
stage('Generate documentation') {
steps {
sh 'vendor/bin/phpdox -f phpdox.xml'
}
}
stage('Publish Documentation') {
steps {
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'docs/html',
reportFiles: 'index.html',
reportName: "API"
])
}
}
stage('Cleanup') {
steps {
sh 'rm -rf silverstripe-cache'
}
}
}
post {
always {
junit 'build/logs/*.xml'
recordIssues enabledForFailure: true, tool: checkStyle(pattern: '**/logs/checkstyle.xml')
recordIssues enabledForFailure: true, tool: cpd(pattern: '**/logs/pmd-cpd.xml')
// recordIssues enabledForFailure: true, tool: pmd(pattern: '**/logs/pmd.xml')
}
}
}