File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -160,11 +160,33 @@ download_reporter() {
160160 fi
161161}
162162
163+ is_self_hosted_instance () {
164+ if [[ " $CODACY_API_BASE_URL " == " https://api.codacy.com" * ]] || \
165+ [[ " $CODACY_API_BASE_URL " == " https://app.codacy.com" * ]] || \
166+ [[ " $CODACY_API_BASE_URL " == " https://app.staging.codacy.org" * ]] || \
167+ [[ " $CODACY_API_BASE_URL " == " https://api.staging.codacy.org" * ]] || \
168+ [[ " $CODACY_API_BASE_URL " == " https://app.dev.codacy.org" * ]] || \
169+ [[ " $CODACY_API_BASE_URL " == " https://api.dev.codacy.org" * ]]; then
170+ false
171+ else
172+ true
173+ fi
174+ }
175+
163176os_name=$( uname)
164177
178+ # This version should be one that matches the latest self hosted release.
179+ SELF_HOSTED_CODACY_REPORTER_VERSION=" 13.10.15"
180+
165181# Find the latest version in case is not specified
166182if [ -z " $CODACY_REPORTER_VERSION " ] || [ " $CODACY_REPORTER_VERSION " = " latest" ]; then
167- CODACY_REPORTER_VERSION=$( download_stdout " https://artifacts.codacy.com/bin/codacy-coverage-reporter/latest" )
183+ # In case of a self hosted installation, pin a version to the latest released self hosted version working coverage reporter
184+ if [ -n " $CODACY_API_BASE_URL " ] && is_self_hosted_instance; then
185+ log " Self hosted instance detected, setting codacy coverage reporter version to $SELF_HOSTED_CODACY_REPORTER_VERSION "
186+ CODACY_REPORTER_VERSION=" $SELF_HOSTED_CODACY_REPORTER_VERSION "
187+ else
188+ CODACY_REPORTER_VERSION=$( download_stdout " https://artifacts.codacy.com/bin/codacy-coverage-reporter/latest" )
189+ fi
168190fi
169191
170192# Temporary folder for downloaded files
You can’t perform that action at this time.
0 commit comments