forked from MicrosoftLearning/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MicrosoftLearning#54 from MicrosoftLearning/sonarc…
…loud-lab-update Sonarcloud Lab update
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|