-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline-ci.yaml
153 lines (132 loc) · 5.28 KB
/
pipeline-ci.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
branches:
include:
- master
stages:
- stage: Fronted_Build
displayName: 'FaceRecog frontend Build'
jobs:
- job: Build
displayName: 'Building FaceRecog frontend component'
pool:
name: Hosted Windows 2019 with VS2019
steps:
- checkout: self
fetchDepth: 10
clean: false
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- task: Npm@1
displayName: 'npm build ci'
inputs:
command: custom
verbose: false
customCommand: 'run build-ci'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts frontend-ci'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/dist/artifacts'
ArtifactName: 'frontend-ci'
- task: Npm@1
displayName: 'npm build prod'
inputs:
command: custom
verbose: false
customCommand: 'run build-prod'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts frontend-prod'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/dist/artifacts'
ArtifactName: 'frontend-prod'
- script: |
git clone https://github.com/zufengxu/facerecog-infrastructure.git
workingDirectory: '$(Build.SourcesDirectory)'
displayName: 'Command Line Script'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts infrastructure'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/facerecog-infrastructure'
ArtifactName: infrastructure
- stage: FaceRecog_Front_Release_CI
displayName: 'FaceRecog CI Deployment'
jobs:
- deployment: Deployment_Continuous_Integration
displayName: 'Deploying to CI environment'
pool:
name: Hosted Windows 2019 with VS2019
variables:
enterpriseCode: 'par'
environmentCode: 'ci'
contextCode: 'fr'
regionCode: 'sea'
environment: 'Continuous Integration'
strategy:
runOnce:
deploy:
steps:
- template: deployment-steps.yaml
parameters:
enterpriseCode: ${{ variables.enterpriseCode }}
environmentCode: ${{ variables.environmentCode }}
contextCode: ${{ variables.contextCode }}
regionCode: ${{ variables.regionCode }}
functionKey: $(functionKey-ci)
azureSubscription: 'Microsoft Azure Sponsorship (4a72c271-a544-46af-8e9d-75bb1f1e9865)'
- task: ArchiveFiles@2
displayName: zip
inputs:
rootFolderOrFile: '$(Agent.BuildDirectory)/frontend-ci'
includeRootFolder: false
archiveFile: '$(Agent.BuildDirectory)/frontend.zip'
- task: AzureRmWebAppDeployment@4
displayName: 'Frontend webapp deploy: ${{ variables.enterpriseCode }}-${{ variables.environmentCode }}-${{ variables.regionCode }}-aglr-${{ variables.contextCode }}'
inputs:
azureSubscription: 'Microsoft Azure Sponsorship (4a72c271-a544-46af-8e9d-75bb1f1e9865)'
WebAppName: ' ${{ variables.enterpriseCode }}-${{ variables.environmentCode }}-${{ variables.regionCode }}-aglr-${{ variables.contextCode }}'
packageForLinux: '$(Agent.BuildDirectory)/frontend.zip'
enableCustomDeployment: true
DeploymentType: zipDeploy
- stage: FaceRecog_Front_Release_Prod
displayName: 'FaceRecog Prod Deployment'
dependsOn: FaceRecog_Front_Release_CI
condition: succeeded()
jobs:
- deployment: Deployment_Production
displayName: 'Deploying to production environment'
pool:
name: Hosted Windows 2019 with VS2019
variables:
enterpriseCode: 'par'
environmentCode: pr
contextCode: 'fr'
regionCode: 'sea'
environment: 'Production'
strategy:
runOnce:
deploy:
steps:
- template: deployment-steps.yaml
parameters:
enterpriseCode: ${{ variables.enterpriseCode }}
environmentCode: ${{ variables.environmentCode }}
contextCode: ${{ variables.contextCode }}
regionCode: ${{ variables.regionCode }}
functionKey: $(functionKey-ci)
azureSubscription: 'Microsoft Azure Sponsorship (4a72c271-a544-46af-8e9d-75bb1f1e9865)'
- task: ArchiveFiles@2
displayName: zip
inputs:
rootFolderOrFile: '$(Agent.BuildDirectory)/frontend-prod'
includeRootFolder: false
archiveFile: '$(Agent.BuildDirectory)/frontend.zip'
- task: AzureRmWebAppDeployment@4
displayName: 'Frontend webapp deploy: ${{ variables.enterpriseCode }}-${{ variables.environmentCode }}-${{ variables.regionCode }}-aglr-${{ variables.contextCode }}'
inputs:
azureSubscription: 'Microsoft Azure Sponsorship (4a72c271-a544-46af-8e9d-75bb1f1e9865)'
WebAppName: ' ${{ variables.enterpriseCode }}-${{ variables.environmentCode }}-${{ variables.regionCode }}-aglr-${{ variables.contextCode }}'
packageForLinux: '$(Agent.BuildDirectory)/frontend.zip'
enableCustomDeployment: true
DeploymentType: zipDeploy