-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
150 lines (150 loc) · 7.49 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
pipeline {
agent any
stages {
stage('Prepare directories') {
steps {
sh 'mkdir -p reports'
}
}
stage('Build') {
agent any
steps {
sh 'docker-compose up -d'
sh 'docker exec -w /app symfony_kindle composer install'
}
}
stage('Test') {
steps {
sh 'docker exec -w /app symfony_kindle php ./bin/phpunit --coverage-clover=\'reports/coverage/coverage.xml\' --coverage-html=\'reports/coverage\''
}
}
stage('Coverage') {
steps {
step([$class: 'CloverPublisher', cloverReportDir: '/reports/coverage', cloverReportFileName: 'coverage.xml'])
}
}
stage('PHP_CodeSniffer') {
steps {
sh 'phpcs --standard=PSR2 --report=checkstyle --report-file=reports/checkstyle.xml src || exit 0'
recordIssues(tools: [checkStyle(pattern: '**/reports/checkstyle.xml')])
}
}
stage('Lines of Code') {
steps {
sh 'phploc --count-tests --exclude vendor/ --log-csv reports/phploc.csv --log-xml reports/phploc.xml .'
script {
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d900.csv',
group: 'phploc',
title: 'A - Lines of code', useDescr: false,
yaxis: 'Lines of Code',
csvSeries: [[
exclusionValues: 'Lines of Code (LOC),Comment Lines of Code (CLOC),Non-Comment Lines of Code (NCLOC),Logical Lines of Code (LLOC)',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d901.csv',
group: 'phploc',
title: 'B - Structures Containers',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Directories,Files,Namespaces',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d902.csv',
group: 'phploc',
title: 'C - Average Length',
yaxis: 'Average Lines of Code',
csvSeries: [[
exclusionValues: 'Average Class Length (LLOC),Average Method Length (LLOC),Average Function Length (LLOC)',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d903.csv',
group: 'phploc',
title: 'D - Relative Cyclomatic Complexity',
yaxis: 'Cyclomatic Complexity by Structure',
csvSeries: [[
exclusionValues: 'Cyclomatic Complexity / Lines of Code,Cyclomatic Complexity / Number of Methods',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d904.csv',
group: 'phploc',
title: 'E - Types of Classes',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Classes,Abstract Classes,Concrete Classes',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d905.csv',
group: 'phploc',
title: 'F - Types of Methods',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Methods,Non-Static Methods,Static Methods,Public Methods,Non-Public Methods',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d906.csv',
group: 'phploc',
title: 'G - Types of Constants',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Constants,Global Constants,Class Constants',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d909.csv',
group: 'phploc',
title: 'H - Types of Functions',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Functions,Named Functions,Anonymous Functions',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d907.csv',
group: 'phploc',
title: 'I - Testing',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Test Classes,Test Methods',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d908.csv',
group: 'phploc',
title: 'AB - Code Structure by Logical Lines of Code',
yaxis: 'Logical Lines of Code',
csvSeries: [[
exclusionValues: 'Logical Lines of Code (LLOC),Classes Length (LLOC),Functions Length (LLOC),LLOC outside functions or classes',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
plot csvFileName: 'plot-7cc376ec-b513-455f-84d2-97e68468d90a.csv',
group: 'phploc',
title: 'BB - Structure Objects',
yaxis: 'Count',
csvSeries: [[
exclusionValues: 'Interfaces,Traits,Classes,Methods,Functions,Constants',
file: 'reports/phploc.csv',
inclusionFlag: 'INCLUDE_BY_STRING', displayTableFlag: false, url: ''
]],
numBuilds: '100', style: 'line', exclZero: false, keepRecords: false, logarithmic: false, yaxisMaximum: '', yaxisMinimum: ''
}
}
}
}
}