Skip to content

Commit

Permalink
Merge pull request MicrosoftLearning#54 from MicrosoftLearning/sonarc…
Browse files Browse the repository at this point in the history
…loud-lab-update

Sonarcloud Lab update
  • Loading branch information
LuizMacedo authored Feb 24, 2023
2 parents 94113b9 + 15d22b0 commit 4a7c2a7
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .ado/eshoponweb-sonar-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#NAME THE PIPELINE SAME AS FILE (WITHOUT ".yml")
# trigger:
# - main

resources:
repositories:
- repository: self
trigger: none

stages:
- stage: Build
displayName: Build .Net Core Solution
jobs:
- job: Build
pool:
vmImage: ubuntu-latest
steps:

- checkout: self
fetchDepth: 0
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: 'restore'
projects: '**/*.sln'
feedsToUse: 'select'

- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarSC'
organization: 'Your Sonarcloud org'
scannerMode: 'MSBuild'
projectKey: 'your sonarcloud project key'
projectName: 'your sonarcloud project name'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: '**/*.sln'

- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: 'test'
projects: 'tests/UnitTests/*.csproj'

- task: SonarCloudAnalyze@1

- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'

- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: 'publish'
publishWebProjects: true
arguments: '-o $(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: Publish Artifacts ADO - Website
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: Website

0 comments on commit 4a7c2a7

Please sign in to comment.