Hello,
I am having issues setting up a mono repo with dotnet and nextjs using BitBucket pipelines.
I have the following folder structure:
root
- frontend
- backend
I am using the BitBucket pipe for the frontend folder and it works well. However, I am struggling to setup the backend. Since the pipe is not an option there, I am using SonarScanner for MSBuild.
Here is the script I am running:
- mkdir -p /usr/share/man/man1 /usr/share/man/man2 && apt-get update && apt-get install -y --no-install-recommends openjdk-11-jre;
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet tool install --global dotnet-sonarscanner
- dotnet sonarscanner begin /key:"$SONAR_PROJECT_BACKEND" /organization:"$SONAR_ORGANIZATION" /name:sonar.projectName="Spodio Chat (Backend)" /version:"$BITBUCKET_COMMIT" /d:sonar.host.url="$SONAR_URL" /d:sonar.login="$SONAR_TOKEN" /d:sonar.projectBaseDir=backend /d:sonar.cs.opencover.reportsPaths="TestResults/**/coverage.opencover.xml" /d:sonar.sources=src /d:sonar.tests=tests
- dotnet restore backend
- dotnet build backend --no-restore --configuration Release
- dotnet test backend --no-build --configuration Release --test-adapter-path:backend --logger:"junit;LogFilePath=./test-reports/build_${BITBUCKET_BUILD_NUMBER}/junit.xml" --collect:"XPlat Code Coverage" --settings backend/coverlet.runsettings --results-directory TestResults
- dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN"
This is however failing on the post-processing step with:
12:10:17.019 The project base directory doesn't exist.
12:10:17.019 Generation of the sonar-properties file failed. Unable to complete the analysis.
12:10:17.022 Post-processing failed. Exit code: 1
Not sure what I am doing wrong, but I am struggling for a while now. Do you have any suggestions I could try?