-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
69 lines (64 loc) · 1.76 KB
/
azure-pipelines.yml
File metadata and controls
69 lines (64 loc) · 1.76 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
62
63
64
65
66
67
68
69
trigger:
- develop
- main
pr:
branches:
exclude:
- '*'
resources:
- repo: self
variables:
dockerRegistryServiceConnection: 'blindnet-acr'
subscriptionServiceConnection: 'blindnet-dac-arm'
imageRepository: 'storageconnjavademo'
containerRegistry: 'blindnet.azurecr.io'
dockerfilePath: 'example/Dockerfile'
branch: ${{ variables['Build.SourceBranchName'] }}
tag: '$(Build.BuildId)'
${{ if eq(variables['Build.SourceBranchName'], 'main') }}:
slot: 'production'
${{ elseif eq(variables['Build.SourceBranchName'], 'develop') }}:
slot: 'staging'
pool:
vmImage: 'ubuntu-22.04'
steps:
- script: |
sudo apt-get update
sudo apt-get install -y maven
displayName: Install Maven
- task: JavaToolInstaller@0
displayName: Set Java version
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- script: mvn package
displayName: Build & Package
- task: Docker@2
displayName: Build Docker image
inputs:
command: build
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
$(branch)
- task: Docker@2
displayName: Push Docker Image
inputs:
command: push
repository: $(imageRepository)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
$(branch)
- task: AzureWebAppContainer@1
displayName: Deploy
inputs:
azureSubscription: $(subscriptionServiceConnection)
appName: 'blindnet-connector-demo'
imageName: $(containerRegistry)/$(imageRepository):$(tag)
resourceGroupName: 'data-access-component'
deployToSlotOrASE: true
slotName: $(slot)