forked from ksrinivas1/javacode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
77 lines (71 loc) · 1.96 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
# 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
resources:
repositories:
- repository: javacode # The name used to reference this repository in the checkout step
type: github
endpoint: arshadmech
name: arshadmech/javacode
trigger:
- none
pool:
name: pipeline
steps:
- checkout: self
- checkout: javacode
parameters:
- name: myStage
type: string
default: 'Build'
- name: Deploy
type: string
default: 'ovaledge s3'
values:
- ovaledge s3
- default
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**/*.war'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: Container
- stage: Deploy
dependsOn: Build
jobs:
- job: deploy
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'drop'
targetPath: '$(Pipeline.Workspace)'
- task: S3Upload@1
inputs:
awsCredentials: ${{parameters.Deploy}}
regionName: 'ap-south-1'
bucketName: 'qa-weekly-backups'
sourceFolder: '$(Pipeline.Workspace)/webapp/target/'
globExpressions: '*.war'