ci: avoid sonar branch analysis on community edition
This commit is contained in:
parent
4c255a8258
commit
6216d8eac3
1 changed files with 9 additions and 2 deletions
|
|
@ -61,15 +61,22 @@ jobs:
|
|||
echo "Sample files:"
|
||||
find . -maxdepth 2 -type f | head -n 20
|
||||
echo "Running local sonar-scanner..."
|
||||
sonar-scanner \
|
||||
set -- \
|
||||
-Dsonar.host.url="$HOST_URL" \
|
||||
-Dsonar.token="$SONAR_TOKEN" \
|
||||
-Dsonar.projectKey="$PROJECT_KEY" \
|
||||
-Dsonar.branch.name="$BRANCH_NAME" \
|
||||
-Dsonar.sources=. \
|
||||
-Dsonar.scm.disabled=true \
|
||||
-Dsonar.projectBaseDir="$WORKDIR"
|
||||
|
||||
if [ "${SONAR_ENABLE_BRANCH:-}" = "true" ]; then
|
||||
set -- "$@" -Dsonar.branch.name="$BRANCH_NAME"
|
||||
else
|
||||
echo "Branch analysis disabled (requires SonarQube Developer Edition)"
|
||||
fi
|
||||
|
||||
sonar-scanner "$@"
|
||||
|
||||
docker:
|
||||
needs: [lint, sonar]
|
||||
runs-on: self-hosted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue