-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipeline.yml
64 lines (55 loc) · 1.71 KB
/
azure-pipeline.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
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
variables:
#variables for pipeline or to be exported to app service
- group: DEMO_DEV_INFRA_VARIABLE_GROUP
pool:
vmImage: ubuntu-latest
stages:
- stage : build
jobs:
- job:
displayName: build APP
steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: '$(sonarCloudEndpointName)'
organization: '$(sonarCloudOrganization)'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: '$(sonarCloudProjectKey)'
cliProjectName: '$(sonarCloudProjectName)'
cliProjectVersion: '1.0'
cliSources: 'src'
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
displayName: 'SonarCloud'
- stage : Deploy
jobs:
- job:
displayName: Deploy
steps:
- 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'
- task: CopyFiles@2
inputs:
contents: '/home/vsts/work/1/s/target/test*SNAPSHOT-jar-with-dependencies.jar'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: MyBuildOutputs