forked from johanbejarano/sonar-cloud-lab2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
86 lines (77 loc) · 2.71 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maven with SonarCloud analysis
# Build and run tests for Maven projects
# and analyse on SonarCloud
#
# * If necessary, create an endpoint to connect to SonarCloud
#
# * Set the sonarCloudXXX variables below
#
# * Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/en-gb/azure/devops/pipelines/customize-pipeline?view=azure-devops
trigger:
- master
pool:
vmImage: 'ubuntu-20.04'
steps:
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis configuration'
inputs:
SonarCloud: 'sonarcloud'
organization: 'andresfcc96-org'
scannerMode: Other
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
extraProperties: |
sonar.projectKey=AndresFCC96_sonar-cloud-lab2
sonar.organization=andresfcc96-org
# sonar.coverage.jacoco.xmlReportPaths=CCReport43F6D5EF/jacoco.xml
# Initial behavior of Maven task is that the SonarScanner uses information contained in Maven
# object model to provide smart defaults for most of the standard analysis parameters.
# You can however override this by setting wanted properties in this extraProperties space.
# Read more about this : https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/#header-4
- task: Maven@3
displayName: 'Execute Maven verify'
inputs:
mavenPomFile: 'pom.xml'
options: '-Dmaven.test.failure.ignore=true'
mavenOptions: '-Xmx3072m'
mavenVersionOption: 'Default'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
sqMavenPluginVersionChoice: 'latest'
# codeCoverageToolOption: 'JaCoCo'
testResultsFiles: '**/TEST-*.xml'
goals: 'verify'
# Uncomment the next task to wait until SonarCloud processing has
# finished and to publish the result on the Pipeline build summary
- task: SonarCloudPublish@1
displayName: 'Publish results on build summary'
inputs:
pollingTimeoutSec: '300'
- task: Maven@3
displayName: 'Execute Maven package'
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'package -DskipTests=true'
- task: CopyFiles@2
displayName: 'Copy artifacts'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**/target/*.?(war|jar)'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
artifactName: MyBuildOutputs