Azure DevOps Contd
Static Code Analysis
- Maven static code analysis
---
pool: Default
trigger: none
pr:
- main
steps:
- task: SonarCloudPrepare@3
inputs:
SonarCloud: SONAR_CLOUD
scannerMode: other
organization: dec24
- task: Maven@4
inputs:
mavenPomFile: pom.xml
goals: package
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
#jdkVersionOption: "1.17"
sonarQubeRunAnalysis: true
- task: CopyFiles@2
inputs:
contents: '**/spring-petclinic*.jar'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(Build.Repository.Name)
- task: SonarCloudPublish@3
inputs:
pollingTimeoutSec: '300'
Building dotnet application
- nopCommerce git url
- this requires dotnet 9 SDK
- steps:
- clone
- dotnet test -c Release
this fails
- dotnet publish
we need to create a folder
- publish artifacts
- Write a azure pipelines job on pull request to develop branch
---
pool: Default
trigger: none
pr:
- develop
variables:
webproject: 'src/Presentation/Nop.Web/Nop.Web.csproj'
testproject: 'src/Tests/Nop.Tests/Nop.Tests.csproj'
steps:
- task: DotNetCoreCLI@2
displayName: Build the code
inputs:
command: 'build'
projects: $(webproject)
- task: DotNetCoreCLI@2
displayName: publish nopCommerce
inputs:
command: 'publish'
publishWebProjects: false
projects: $(webproject)
arguments: '-o $(Build.ArtifactStagingDirectory)/Output'
zipAfterPublish: true
modifyOutputPath: true
# todo: add publish artifacts to download from azure devops
User Defined Variables
Like this:
Like Loading...