@@ -65,6 +65,9 @@ if [ "${SPRING_PROFILES_ACTIVE:-}" = 'travis' ] && [ "${TRAVIS_PULL_REQUEST:-fal
6565 DANGER_STATUS=
6666fi
6767
68+ CURDIR=" $( dirname " $0 " ) "
69+ EXEC_CMD=" $CURDIR /../execute-command.sh"
70+
6871echo
6972
7073if [ " $RUN_ONLY_INTEGRATION_TESTS " = ' no' ]; then
@@ -144,130 +147,85 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
144147 echo
145148
146149 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
149151 fi
150152 print_status " $CS_STATUS " ' Run CheckStyle'
151153
152154 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
155156 fi
156157 print_status " $PMD_STATUS " ' Run PMD'
157158
158159 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
161161 fi
162162 print_status " $LICENSE_STATUS " ' Check license headers'
163163
164164 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
167166 fi
168167 print_status " $POM_STATUS " ' Check sorting of pom.xml'
169168
170169 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
173171 fi
174172 print_status " $BOOTLINT_STATUS " ' Run bootlint'
175173
176174 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
183176 fi
184177 print_status " $RFLINT_STATUS " ' Run robot framework lint'
185178
186179 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
196181 fi
197182 print_status " $SHELLCHECK_STATUS " ' Run shellcheck'
198183
199184 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
202186 fi
203187 print_status " $JASMINE_STATUS " ' Run JavaScript unit tests'
204188
205189 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
223191 fi
224192 print_status " $HTML_STATUS " ' Run html5validator'
225193
226194 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
229196 fi
230197 print_status " $ENFORCER_STATUS " ' Run maven-enforcer-plugin'
231198
232199 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
235201 fi
236202 print_status " $TEST_STATUS " ' Run unit tests'
237203
238204 if [ " $CODENARC_STATUS " != ' skip' ]; then
239205 # 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
242207 fi
243208 print_status " $CODENARC_STATUS " ' Run CodeNarc'
244209
245210 if [ " $SPOTBUGS_STATUS " != ' skip' ]; then
246211 # 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
249213 fi
250214 print_status " $SPOTBUGS_STATUS " ' Run SpotBugs'
251215
252216 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
259218 fi
260219 print_status " $ANSIBLE_LINT_STATUS " ' Run Ansible Lint'
261220fi
262221
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
265223
266224print_status " $VERIFY_STATUS " ' Run integration tests'
267225
268226
269227if [ " $DANGER_STATUS " != ' skip' ]; then
270- danger > danger.log 2>&1 || DANGER_STATUS=fail
228+ " $EXEC_CMD " danger > danger.log 2>&1 || DANGER_STATUS=fail
271229fi
272230print_status " $DANGER_STATUS " ' Run danger'
273231
0 commit comments