-
Notifications
You must be signed in to change notification settings - Fork 16
/
azure-pipeline.yaml
75 lines (69 loc) · 2.71 KB
/
azure-pipeline.yaml
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
trigger:
batch: true
branches:
include:
- develop
- main
- devops
variables:
agentOS: ubuntu-latest
stages:
- stage: Build
displayName: Build and push docker image
jobs:
- job: Build
pool:
vmImage: $(agentOS)
steps:
- task: DownloadSecureFile@1
name: envStage
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/devops'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
inputs:
secureFile: 'env-front-stage'
- task: Bash@3
name: setEnvStage
inputs:
targetType: 'inline'
script: 'mv $(envStage.secureFilePath) .env'
- task: DockerCompose@1
inputs:
dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose'
containerregistrytype: 'Azure Container Registry'
azureSubscription: 'S2s-Service'
azureContainerRegistry: '{"loginServer":"s2sstage.azurecr.io", "id" : "/subscriptions/734fc759-c3a2-4e22-a478-301dc5b10496/resourceGroups/Space2Study/providers/Microsoft.ContainerRegistry/registries/S2sStage"}'
dockerComposeFile: '**/compose.yml'
dockerComposeFileArgs: |
PROXY_API_URL=$(PROXY_API_URL)
password=$(password)
projectName: 'front-stage'
action: 'Build services'
additionalImageTags: '$(Build.BuildId)'
- task: DockerCompose@1
inputs:
dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose'
containerregistrytype: 'Azure Container Registry'
azureSubscription: 'S2s-Service'
azureContainerRegistry: '{"loginServer":"s2sstage.azurecr.io", "id" : "/subscriptions/734fc759-c3a2-4e22-a478-301dc5b10496/resourceGroups/Space2Study/providers/Microsoft.ContainerRegistry/registries/S2sStage"}'
dockerComposeFile: '**/compose.yml'
dockerComposeFileArgs: |
PROXY_API_URL=$(PROXY_API_URL)
password=$(password)
projectName: 'front-stage'
action: 'Push services'
additionalImageTags: '$(Build.BuildId)'
- stage: Deploy
displayName: Deploy image to app service
jobs:
- job: Deploy
pool:
vmImage: $(agentOS)
steps:
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'S2s-Service'
appType: 'webAppContainer'
WebAppName: 's2s-front-stage'
DockerNamespace: 's2sstage.azurecr.io'
DockerRepository: 'frontstage_nginx'
DockerImageTag: '$(Build.BuildId)'