Skip to content

Commit d44363f

Browse files
committed
Fix base path for call to update the build status as well
1 parent 652e3e4 commit d44363f

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

assets/check

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,7 @@ if [ -n "$pull_requests" ]; then
6868
uri_parser "$uri"
6969
repo_host="${uri_schema}://${uri_address}"
7070

71-
# get base path in case bitbucket does not run on /
72-
base_path=""
73-
for i in "${!uri_parts[@]}"
74-
do
75-
if [ ${uri_parts[$i]} = "scm" ]; then
76-
break
77-
fi
78-
79-
base_path=$base_path"/"${uri_parts[$i]}
80-
done
81-
82-
repo_host=${repo_host}${base_path}
71+
repo_host=${repo_host}$(getBasePathOfBitbucket)
8372

8473
versions="[]"
8574
while read pull_request ; do

assets/helpers/utils.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,19 @@ rawurlencode() {
146146
regex_escape() {
147147
echo "$1" | sed 's/[^^]/[&]/g; s/\^/\\^/g'
148148
}
149+
150+
getBasePathOfBitbucket() {
151+
# get base path in case bitbucket does not run on /
152+
153+
local base_path=""
154+
for i in "${!uri_parts[@]}"
155+
do
156+
if [ ${uri_parts[$i]} = "scm" ]; then
157+
break
158+
fi
159+
160+
base_path=$base_path"/"${uri_parts[$i]}
161+
done
162+
163+
echo ${base_path}
164+
}

assets/out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ repo_project=$(basename $(dirname "$uri"))
121121

122122
# parse uri and retrieve host
123123
uri_parser "$uri"
124-
repo_host="${uri_schema}://${uri_address}"
124+
repo_host="${uri_schema}://${uri_address}"$(getBasePathOfBitbucket)
125125

126126
# include ATC_EXTERNAL_URL in build status key, different sources should have different builds
127127
build_key="$BUILD_TEAM_NAME-$BUILD_PIPELINE_NAME-$BUILD_JOB_NAME-$ATC_EXTERNAL_URL"

0 commit comments

Comments
 (0)