You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local build_url_job="$ATC_EXTERNAL_URL/teams/$(rawurlencode "$BUILD_TEAM_NAME")/pipelines/$(rawurlencode "$BUILD_PIPELINE_NAME")/jobs/$(rawurlencode "$BUILD_JOB_NAME")"
118
+
echo"[*Build$type* at **[${BUILD_PIPELINE_NAME} > ${BUILD_JOB_NAME}]($build_url_job)** for $hash"
119
+
}
120
+
111
121
bitbucket_pullrequest_progress_commit_match() {
112
122
# $1: pull request comment
113
123
# $2: pull request hash
114
-
# $3: type of build to match (default: Started|Finished)
124
+
# $3: type of build to match
115
125
local comment="$1"
116
126
local hash="$2"
117
-
local type=${3:-(Started|Finished)}
118
-
local build_url_job="$ATC_EXTERNAL_URL/teams/$(rawurlencode "$BUILD_TEAM_NAME")/pipelines/$(rawurlencode "$BUILD_PIPELINE_NAME")/jobs/$(rawurlencode "$BUILD_JOB_NAME")"
119
-
echo"$comment"| grep -Ec "^\[\*Build$type\* at \*\*\[${BUILD_PIPELINE_NAME} \> ${BUILD_JOB_NAME}\]\($build_url_job\)\*\* for $hash"> /dev/null
127
+
local type="$3"
128
+
129
+
local msg=$(bitbucket_pullrequest_progress_msg_start "$hash""$type")
local build_url_job="$ATC_EXTERNAL_URL/teams/$(rawurlencode "$BUILD_TEAM_NAME")/pipelines/$(rawurlencode "$BUILD_PIPELINE_NAME")/jobs/$(rawurlencode "$BUILD_JOB_NAME")"
128
-
local build_url="${build_url_job}/builds/$(rawurlencode "$BUILD_NAME")"
129
-
local build_status_pre="[*Build"
130
-
local build_status_post="* at **[${BUILD_PIPELINE_NAME} > ${BUILD_JOB_NAME}]($build_url_job)** for $2"
131
-
if [ "$2"=="$3" ];then
132
-
build_status_post+=" into $4]"
138
+
local hash="$2"
139
+
140
+
local progress_msg_end=""
141
+
if [ "$hash"=="$3" ];then
142
+
progress_msg_end+=" into $4]"
133
143
else
134
-
build_status_post="] $3 into $4"
144
+
progress_msg_end="] $3 into $4"
135
145
fi
146
+
147
+
local build_url="$ATC_EXTERNAL_URL/teams/$(rawurlencode "$BUILD_TEAM_NAME")/pipelines/$(rawurlencode "$BUILD_PIPELINE_NAME")/jobs/$(rawurlencode "$BUILD_JOB_NAME")/builds/$(rawurlencode "$BUILD_NAME")"
136
148
local build_result_pre=" \n\n **["
137
149
local build_result_post="]($build_url)** - Build #$BUILD_NAME"
0 commit comments