2020-05-01 14:15:42 -04:00
|
|
|
trigger:
|
2020-05-04 11:59:23 -04:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
linux:
|
|
|
|
imageName: "ubuntu-16.04"
|
|
|
|
mac:
|
|
|
|
imageName: "macos-10.14"
|
|
|
|
windows:
|
|
|
|
imageName: "vs2017-win2016"
|
|
|
|
maxParallel: 3
|
2020-05-01 14:15:42 -04:00
|
|
|
|
|
|
|
pool:
|
2020-05-04 11:59:23 -04:00
|
|
|
vmImage: $(imageName)
|
|
|
|
|
|
|
|
variables:
|
|
|
|
currentImage: $(imageName)
|
2020-05-01 14:15:42 -04:00
|
|
|
|
|
|
|
steps:
|
|
|
|
|
2020-05-04 11:59:23 -04:00
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: |
|
|
|
|
[xml]$pomXml = Get-Content .\pom.xml
|
|
|
|
# version
|
|
|
|
Write-Host $pomXml.project.version
|
|
|
|
$version=$pomXml.project.version
|
|
|
|
Write-Host "##vso[task.setvariable variable=version]$version"
|
|
|
|
|
|
|
|
- task: Maven@3
|
|
|
|
inputs:
|
|
|
|
mavenPomFile: 'pom.xml'
|
|
|
|
mavenOptions: '-Xmx3072m'
|
|
|
|
javaHomeOption: 'JDKVersion'
|
|
|
|
jdkVersionOption: '1.8'
|
|
|
|
jdkArchitectureOption: 'x64'
|
|
|
|
publishJUnitResults: true
|
|
|
|
testResultsFiles: '**/surefire-reports/TEST-*.xml'
|
|
|
|
goals: 'package cobertura:cobertura'
|
|
|
|
|
|
|
|
- bash: echo Current version => $(version)
|
|
|
|
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: "Cobertura"
|
|
|
|
summaryFileLocation: "$(System.DefaultWorkingDirectory)/report/**/site/jacoco-aggregate/jacoco.xml"
|
|
|
|
failIfCoverageEmpty: true
|
|
|
|
|
|
|
|
# - task: PublishPipelineArtifact@1
|
|
|
|
# condition: eq(variables.currentImage, 'ubuntu-16.04')
|
|
|
|
# inputs:
|
|
|
|
# targetPath: "$(System.DefaultWorkingDirectory)/target/ProjectA-$(version).jar"
|
|
|
|
# artifactName: ProjectAOutput
|
|
|
|
|
|
|
|
|