-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
65 lines (58 loc) · 1.98 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- development
pool:
vmImage: ubuntu-latest
variables:
serviceConnection: CHEWSY_VOTE_SERVICE
appServiceName: chewsy-vote
steps:
- task: Gradle@3
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'build test'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
testRunTitle: 'Voting Microservice Tests'
jdkVersionOption: '1.17'
javaHomeOption: 'JDKVersion'
sonarQubeRunAnalysis: false
sqGradlePluginVersionChoice: 'build'
spotBugsAnalysis: false
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/build/reports/jacoco/test/jacocoTestReport.xml'
pathToSources: '$(System.DefaultWorkingDirectory)/**/src/main/java/'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/build/reports/jacoco/test/html'
additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/**/build/jacoco/*.exec'
failIfCoverageEmpty: true
- task: CopyFiles@2
displayName: 'Copy files'
inputs:
sourceFolder: 'build'
Contents: '**/*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
cleanTargetFolder: true
- task: ArchiveFiles@2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifacts'
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
- task: AzureWebApp@1
displayName: 'Deploy to Azure Web Apps'
inputs:
azureSubscription: '$(serviceConnection)'
appName: '$(appServiceName)'
appType: webApp
package: '$(System.ArtifactsDirectory)/$(Build.BuildId).zip'