-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackEnd.yml
More file actions
62 lines (61 loc) · 1.74 KB
/
BackEnd.yml
File metadata and controls
62 lines (61 loc) · 1.74 KB
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
trigger:
branches:
include:
- master
resources:
repositories:
- repository: self
variables:
- name: dockerRegistryServiceConnection
value: '0999e684-f448-4647-99b1-29dcc3fcd3e1'
- name: imageRepository
value: 'abenzbackend'
- name: containerRegistry
value: 'abenzbackendregistery.azurecr.io'
- name: dockerfilePath
value: 'Dockerfile'
- name: tag
value: 'latest'
- name: vmImageName
value: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build Java app and push Docker image
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Maven@4
displayName: Maven Build, Test, and Package
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: CopyFiles@2
displayName: Copy JAR files to artifact staging directory
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/target/*.jar'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: Publish JAR Artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: Docker@2
displayName: Build and Push Docker Image to Azure Container Registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: '$(dockerfilePath)'
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)