@@ -19,6 +19,7 @@ function regression_tester_setup_ci() {
19
19
20
20
gpg --batch --yes --decrypt --passphrase=" GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
21
21
--output .ci/files/public-env .ci/files/public-env.gpg
22
+ # shellcheck disable=SC1091
22
23
source .ci/files/public-env > /dev/null 2>&1
23
24
rm .ci/files/public-env
24
25
@@ -41,7 +42,7 @@ function regression_tester_setup_ci() {
41
42
function regression_tester_uploadBaseline() {
42
43
local pmdcodeUrl=" https://pmd-code.org/pmd-regression-tester/"
43
44
local baseline_branch=" ${PMD_CI_BRANCH:- $PMD_CI_TAG } "
44
- pmd_ci_log_debug " $FUNCNAME branch=${baseline_branch} "
45
+ pmd_ci_log_debug " ${ FUNCNAME[0]} branch=${baseline_branch} "
45
46
46
47
pmd_ci_log_info " Generating and uploading baseline for pmdtester (${baseline_branch} )..."
47
48
pushd ..
@@ -50,34 +51,34 @@ function regression_tester_uploadBaseline() {
50
51
bundle exec pmdtester \
51
52
--mode single \
52
53
--local-git-repo ./pmd \
53
- --patch-branch ${baseline_branch} \
54
+ --patch-branch " ${baseline_branch} " \
54
55
--patch-config ./pmd/.ci/files/all-java.xml \
55
56
--list-of-project ./pmd/.ci/files/project-list.xml --html-flag \
56
57
--error-recovery
57
- pushd target/reports
58
+ pushd target/reports || { echo " Directory 'target/reports' doesn't exist " ; exit 1 ; }
58
59
BRANCH_FILENAME=" ${baseline_branch/ \/ / _} "
59
- zip -q -r ${BRANCH_FILENAME} -baseline.zip ${BRANCH_FILENAME} /
60
+ zip -q -r " ${BRANCH_FILENAME} -baseline.zip" " ${BRANCH_FILENAME} /"
60
61
# ssh-key for pmd-code.org is setup already by pmd_ci_setup_secrets_ssh
61
- scp
${BRANCH_FILENAME} -baseline.zip
[email protected] :/httpdocs/pmd-regression-tester/
62
+ scp
" ${BRANCH_FILENAME} -baseline.zip" [email protected] :/httpdocs/pmd-regression-tester/
62
63
pmd_ci_log_success " Successfully uploaded ${BRANCH_FILENAME} -baseline.zip to ${pmdcodeUrl} "
63
- popd
64
- popd
64
+ popd || exit 1
65
+ popd || exit 1
65
66
}
66
67
67
68
#
68
69
# Execute danger, which executes pmd-regression-tester (via Dangerfile).
69
70
#
70
71
function regression_tester_executeDanger() {
71
- pmd_ci_log_debug " $FUNCNAME "
72
+ pmd_ci_log_debug " ${ FUNCNAME[0]} "
72
73
73
74
# Create a corresponding remote branch locally
74
- if ! git show-ref --verify --quiet refs/heads/${PMD_CI_BRANCH} ; then
75
- git fetch --no-tags --depth=1 origin +refs/heads/${PMD_CI_BRANCH} :refs/remotes/origin/${PMD_CI_BRANCH}
76
- git branch ${PMD_CI_BRANCH} origin/${PMD_CI_BRANCH}
75
+ if ! git show-ref --verify --quiet " refs/heads/${PMD_CI_BRANCH} " ; then
76
+ git fetch --no-tags --depth=1 origin " +refs/heads/${PMD_CI_BRANCH} :refs/remotes/origin/${PMD_CI_BRANCH} "
77
+ git branch " ${PMD_CI_BRANCH} " " origin/${PMD_CI_BRANCH} "
77
78
pmd_ci_log_debug " Created local branch ${PMD_CI_BRANCH} "
78
79
fi
79
80
# Fetch more commits of the PR for danger and regression tester
80
- git fetch --no-tags --depth=50 origin +$( git rev-parse HEAD^2) :
81
+ git fetch --no-tags --depth=50 origin " +$( git rev-parse HEAD^2) :"
81
82
# Fetch more commits from master branch for regression tester
82
83
if [[ " ${PMD_CI_BRANCH} " != " master" ]]; then
83
84
git fetch --no-tags --depth=50 origin +master:
0 commit comments