forked from bula21/mova-TraMat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
76 lines (72 loc) · 2.32 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
76
resources:
- repo: self
variables:
imageRepository: "movatramat"
containerRegistry: "mova21.azurecr.io"
dockerfilePath: "$(Build.SourcesDirectory)/Dockerfile"
tag: "latest"
# Agent VM image name
vmImageName: "ubuntu-latest"
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
inputs:
command: build
dockerfile: $(dockerfilePath)
arguments: --build-arg EMAIL_SECRET=$(EMAIL_SECRET)
env:
EMAIL_SECRET: $(EMAIL_SECRET)
- stage: Deploy
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job: Deploy
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build
inputs:
command: build
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
arguments: --build-arg EMAIL_SECRET=$(EMAIL_SECRET)
env:
EMAIL_SECRET: $(EMAIL_SECRET)
- task: Docker@2
displayName: Push
inputs:
command: push
containerRegistry: $(dockerRegistryServiceConnection)
repository: $(imageRepository)
tags: |
$(tag)
env:
EMAIL_SECRET: $(EMAIL_SECRET)
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: "AzureRM"
azureSubscription: "Subscription"
appType: "webAppContainer"
WebAppName: "mova-tramat-as"
DockerNamespace: "$(containerRegistry)"
DockerRepository: "$(imageRepository)"
DockerImageTag: "$(tag)"
- task: AzureAppServiceManage@0
inputs:
azureSubscription: "Subscription"
Action: "Stop Azure App Service"
WebAppName: "mova-tramat-as"
- task: AzureAppServiceManage@0
inputs:
azureSubscription: "Subscription"
Action: "Start Azure App Service"
WebAppName: "mova-tramat-as"