@@ -65,6 +65,9 @@ if [ "${SPRING_PROFILES_ACTIVE:-}" = 'travis' ] && [ "${TRAVIS_PULL_REQUEST:-fal
65
65
DANGER_STATUS=
66
66
fi
67
67
68
+ CURDIR=" $( dirname " $0 " ) "
69
+ EXEC_CMD=" $CURDIR /../execute-command.sh"
70
+
68
71
echo
69
72
70
73
if [ " $RUN_ONLY_INTEGRATION_TESTS " = ' no' ]; then
@@ -144,130 +147,85 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
144
147
echo
145
148
146
149
if [ " $CS_STATUS " != ' skip' ]; then
147
- mvn --batch-mode checkstyle:check -Dcheckstyle.violationSeverity=warning \
148
- > cs.log 2>&1 || CS_STATUS=fail
150
+ " $EXEC_CMD " checkstyle > cs.log 2>&1 || CS_STATUS=fail
149
151
fi
150
152
print_status " $CS_STATUS " ' Run CheckStyle'
151
153
152
154
if [ " $PMD_STATUS " != ' skip' ]; then
153
- mvn --batch-mode pmd:check \
154
- > pmd.log 2>&1 || PMD_STATUS=fail
155
+ " $EXEC_CMD " pmd > pmd.log 2>&1 || PMD_STATUS=fail
155
156
fi
156
157
print_status " $PMD_STATUS " ' Run PMD'
157
158
158
159
if [ " $LICENSE_STATUS " != ' skip' ]; then
159
- mvn --batch-mode license:check \
160
- > license.log 2>&1 || LICENSE_STATUS=fail
160
+ " $EXEC_CMD " check-license > license.log 2>&1 || LICENSE_STATUS=fail
161
161
fi
162
162
print_status " $LICENSE_STATUS " ' Check license headers'
163
163
164
164
if [ " $POM_STATUS " != ' skip' ]; then
165
- mvn --batch-mode sortpom:verify -Dsort.verifyFail=stop \
166
- > pom.log 2>&1 || POM_STATUS=fail
165
+ " $EXEC_CMD " check-pom > pom.log 2>&1 || POM_STATUS=fail
167
166
fi
168
167
print_status " $POM_STATUS " ' Check sorting of pom.xml'
169
168
170
169
if [ " $BOOTLINT_STATUS " != ' skip' ]; then
171
- find src/main -type f -name ' *.html' -print0 | xargs -0 bootlint --disable W013 \
172
- > bootlint.log 2>&1 || BOOTLINT_STATUS=fail
170
+ " $EXEC_CMD " bootlint > bootlint.log 2>&1 || BOOTLINT_STATUS=fail
173
171
fi
174
172
print_status " $BOOTLINT_STATUS " ' Run bootlint'
175
173
176
174
if [ " $RFLINT_STATUS " != ' skip' ]; then
177
- rflint \
178
- --error=all \
179
- --ignore TooFewKeywordSteps \
180
- --configure LineTooLong:130 \
181
- src/test/robotframework \
182
- > rflint.log 2>&1 || RFLINT_STATUS=fail
175
+ " $EXEC_CMD " rflint > rflint.log 2>&1 || RFLINT_STATUS=fail
183
176
fi
184
177
print_status " $RFLINT_STATUS " ' Run robot framework lint'
185
178
186
179
if [ " $SHELLCHECK_STATUS " != ' skip' ]; then
187
- # Shellcheck doesn't support recursive scanning: https://github.com/koalaman/shellcheck/issues/143
188
- # Also I don't want to invoke it many times (slower, more code for handling failures), so I prefer this way.
189
- # shellcheck disable=SC2207
190
- SHELL_FILES=( $( find src/main/scripts -type f -name ' *.sh' ) )
191
- shellcheck \
192
- --shell bash \
193
- --format gcc \
194
- " ${SHELL_FILES[@]} " \
195
- > shellcheck.log 2>&1 || SHELLCHECK_STATUS=fail
180
+ " $EXEC_CMD " shellcheck > shellcheck.log 2>&1 || SHELLCHECK_STATUS=fail
196
181
fi
197
182
print_status " $SHELLCHECK_STATUS " ' Run shellcheck'
198
183
199
184
if [ " $JASMINE_STATUS " != ' skip' ]; then
200
- mvn --batch-mode jasmine:test \
201
- > jasmine.log 2>&1 || JASMINE_STATUS=fail
185
+ " $EXEC_CMD " jasmine > jasmine.log 2>&1 || JASMINE_STATUS=fail
202
186
fi
203
187
print_status " $JASMINE_STATUS " ' Run JavaScript unit tests'
204
188
205
189
if [ " $HTML_STATUS " != ' skip' ]; then
206
- # FIXME: remove ignoring of error about alt attribute after resolving #314
207
- # @todo #109 Check src/main/config/nginx/503.*html by html5validator
208
- # @todo #695 /series/import/request/{id}: use divs instead of table for elements aligning
209
- html5validator \
210
- --root src/main/webapp/WEB-INF/views \
211
- --no-langdetect \
212
- --ignore-re \
213
- ' Attribute “(th|sec|togglz|xmlns):[a-z]+” not allowed' \
214
- ' Attribute “th:[-a-z]+” not allowed on element "body" at this point' \
215
- ' Attribute “(th|sec|togglz):[-a-z]+” is not serializable' \
216
- ' Attribute with the local name “xmlns:[a-z]+” is not serializable' \
217
- --ignore \
218
- ' An "img" element must have an "alt" attribute' \
219
- ' Element "option" without attribute "label" must not be empty' \
220
- ' The "width" attribute on the "td" element is obsolete' \
221
- --show-warnings \
222
- > validator.log 2>&1 || HTML_STATUS=fail
190
+ " $EXEC_CMD " html5validator > validator.log 2>&1 || HTML_STATUS=fail
223
191
fi
224
192
print_status " $HTML_STATUS " ' Run html5validator'
225
193
226
194
if [ " $ENFORCER_STATUS " != ' skip' ]; then
227
- mvn --batch-mode enforcer:enforce \
228
- > enforcer.log 2>&1 || ENFORCER_STATUS=fail
195
+ " $EXEC_CMD " enforcer > enforcer.log 2>&1 || ENFORCER_STATUS=fail
229
196
fi
230
197
print_status " $ENFORCER_STATUS " ' Run maven-enforcer-plugin'
231
198
232
199
if [ " $TEST_STATUS " != ' skip' ]; then
233
- mvn --batch-mode test -Denforcer.skip=true -DskipMinify=true -DdisableXmlReport=false -Dskip.npm -Dskip.installnodenpm \
234
- > test.log 2>&1 || TEST_STATUS=fail
200
+ " $EXEC_CMD " unit-tests > test.log 2>&1 || TEST_STATUS=fail
235
201
fi
236
202
print_status " $TEST_STATUS " ' Run unit tests'
237
203
238
204
if [ " $CODENARC_STATUS " != ' skip' ]; then
239
205
# run after tests for getting compiled sources
240
- mvn --batch-mode codenarc:codenarc -Dcodenarc.maxPriority1Violations=0 -Dcodenarc.maxPriority2Violations=0 -Dcodenarc.maxPriority3Violations=0 \
241
- > codenarc.log 2>&1 || CODENARC_STATUS=fail
206
+ " $EXEC_CMD " codenarc > codenarc.log 2>&1 || CODENARC_STATUS=fail
242
207
fi
243
208
print_status " $CODENARC_STATUS " ' Run CodeNarc'
244
209
245
210
if [ " $SPOTBUGS_STATUS " != ' skip' ]; then
246
211
# run after tests for getting compiled sources
247
- mvn --batch-mode spotbugs:check \
248
- > spotbugs.log 2>&1 || SPOTBUGS_STATUS=fail
212
+ " $EXEC_CMD " spotbugs > spotbugs.log 2>&1 || SPOTBUGS_STATUS=fail
249
213
fi
250
214
print_status " $SPOTBUGS_STATUS " ' Run SpotBugs'
251
215
252
216
if [ " $ANSIBLE_LINT_STATUS " != ' skip' ]; then
253
- ansible-lint \
254
- infra/vagrant/provisioning/prod.yml \
255
- infra/vagrant/provisioning/vagrant.yml \
256
- infra/vagrant/provisioning/bootstrap.yml \
257
- src/main/scripts/ci/ansible/deploy.yml \
258
- > ansible_lint.log 2>&1 || ANSIBLE_LINT_STATUS=fail
217
+ " $EXEC_CMD " ansible-lint > ansible_lint.log 2>&1 || ANSIBLE_LINT_STATUS=fail
259
218
fi
260
219
print_status " $ANSIBLE_LINT_STATUS " ' Run Ansible Lint'
261
220
fi
262
221
263
- mvn --batch-mode --activate-profiles frontend,native2ascii verify -Denforcer.skip=true -DskipUnitTests=true \
264
- > verify.log 2>&1 || VERIFY_STATUS=fail
222
+ " $EXEC_CMD " integration-tests > verify.log 2>&1 || VERIFY_STATUS=fail
265
223
266
224
print_status " $VERIFY_STATUS " ' Run integration tests'
267
225
268
226
269
227
if [ " $DANGER_STATUS " != ' skip' ]; then
270
- danger > danger.log 2>&1 || DANGER_STATUS=fail
228
+ " $EXEC_CMD " danger > danger.log 2>&1 || DANGER_STATUS=fail
271
229
fi
272
230
print_status " $DANGER_STATUS " ' Run danger'
273
231
0 commit comments