File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,19 @@ 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
165178# This version should be one that matches the latest self hosted release.
@@ -168,7 +181,7 @@ SELF_HOSTED_CODACY_REPORTER_VERSION="13.10.15"
168181# Find the latest version in case is not specified
169182if [ -z " $CODACY_REPORTER_VERSION " ] || [ " $CODACY_REPORTER_VERSION " = " latest" ]; then
170183 # 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
184+ if [ -n " $CODACY_API_BASE_URL " ] && is_self_hosted_instance ; then
172185 log " Self hosted instance detected, setting codacy coverage reporter version to $SELF_HOSTED_CODACY_REPORTER_VERSION "
173186 CODACY_REPORTER_VERSION=" $SELF_HOSTED_CODACY_REPORTER_VERSION "
174187 else
You can’t perform that action at this time.
0 commit comments