Monorepo projects
Use these instructions to set up your build pipeline in Azure DevOps when analyzing monorepo projects in SonarQube Cloud.
Last updated
Was this helpful?
Use these instructions to set up your build pipeline in Azure DevOps when analyzing monorepo projects in SonarQube Cloud.
Last updated
Was this helpful?
Was this helpful?
# Template pipeline that build 2 distinct .NET projects, living in 2 separate folders in the repo. We are analyzing them on SonarQube Cloud, each targets a specific SonarQube Cloud project.
trigger:
- main # or another name representing your main branch
pool:
vmImage: windows-latest
steps:
- task: VisualStudioTestPlatformInstaller@1
inputs:
packageFeedSelector: 'nugetOrg'
versionSelector: 'latestPreRelease'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
includePreviewVersions: true
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.9.0'
checkLatest: true
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/*.sln'
feedsToUse: 'select'
- task: SonarCloudPrepare@4
inputs:
SonarCloud: '<YourSonarqubeServiceEndpoint>'
scannerMode: 'dotnet'
projectKey: 'myRepo_myProject1'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: 'myproject1/solution.sln'
arguments: '/nr:false' // this flag is important to avoid DLL lock for the 2nd build/analysis
- task: SonarCloudAnalyze@4
- task: SonarCloudPrepare@4
inputs:
SonarCloud: '<YourSonarqubeServiceEndpoint>'
scannerMode: 'dotnet'
projectKey: 'myRepo_myProject2'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: 'myProject2/solution.sln'
arguments: '/nr:false'
- task: SonarCloudAnalyze@4