Skip to content
Merged
6 changes: 4 additions & 2 deletions .travis/run_sonar_scanner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else
fi


#Are we running on develop branch ?
#Are we running on utPLSQL repo and not an external PR?
echo "Check if we running from develop or on branch"
if [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [[ ! "${BRANCH}" =~ ^(release/v[0-9]+\.[0-9]+\.[0-9]+.*|"${MAIN_DEV_BRANCH}")$ ]]; then

Expand All @@ -39,12 +39,14 @@ if [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [[ ! "${BRANCH}" =~ ^(releas
echo "Updating sonar properties to include branch ${BRANCH}"
add_sonar_property "${BRANCH_SONAR_PROPERTY}" "${BRANCH}"
add_sonar_property "${BRANCH_SONAR_TARGET_PROPERTY}" "${MAIN_DEV_BRANCH}"
else
elif [ "${TRAVIS_PULL_REQUEST_SLUG}" = "${TRAVIS_REPO_SLUG}" ]; then
echo "Updating sonar properties to include pull request ${BRANCH}"
add_sonar_property "${PR_SONAR_TOKEN_PROPERTY}" "${GITHUB_TRAVISCI_TOKEN}"
add_sonar_property "${PR_SONAR_BRANCH_PROPERTY}" "${BRANCH}"
add_sonar_property "${PR_KEY_PROPERTY}" "${PR}"
add_sonar_property "${PR_SONAR_BASE_PROPERTY}" "${PR_BRANCH}"
else
echo "PR from external source no changes to properties."
fi
else
echo "No need to update sonar we building on release or develop"
Expand Down