Skip to content

Commit ac188cf

Browse files
committed
Change the get.sh to pin the coverage reporter version to a working one for self hosted instances
1 parent fc19cff commit ac188cf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

get.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,18 @@ download_reporter() {
162162

163163
os_name=$(uname)
164164

165+
# This version should be one that matches the latest self hosted release.
166+
SELF_HOSTED_CODACY_REPORTER_VERSION="13.10.15"
167+
165168
# Find the latest version in case is not specified
166169
if [ -z "$CODACY_REPORTER_VERSION" ] || [ "$CODACY_REPORTER_VERSION" = "latest" ]; then
167-
CODACY_REPORTER_VERSION=$(download_stdout "https://artifacts.codacy.com/bin/codacy-coverage-reporter/latest")
170+
# In case of a self hosted installation, pin a version to the latest released self hosted version working coverage reporter
171+
if [ -n "$CODACY_API_BASE_URL" ] && [ "$CODACY_API_BASE_URL" != "https://api.codacy.com" ]; then
172+
log "Self hosted instance detected, setting codacy coverage reporter version to $SELF_HOSTED_CODACY_REPORTER_VERSION"
173+
CODACY_REPORTER_VERSION="$SELF_HOSTED_CODACY_REPORTER_VERSION"
174+
else
175+
CODACY_REPORTER_VERSION=$(download_stdout "https://artifacts.codacy.com/bin/codacy-coverage-reporter/latest")
176+
fi
168177
fi
169178

170179
# Temporary folder for downloaded files

0 commit comments

Comments
 (0)