77
88stages :
99
10- - stage : Build_asia
11- displayName : Build stage asia
10+ - stage : Build_europe
11+ displayName : Build stage europe
1212 jobs :
13- - job : Build_asia
13+ - job : Build_europe
1414 steps :
1515
1616 - task : DownloadSecureFile@1
17- displayName : ' download ASIA backendend'
17+ displayName : ' download EU backendend'
1818 inputs :
19- secureFile : ' BACKEND_ENV_FILE_ASIA ' # string. Required. Secure File.
19+ secureFile : ' BACKEND_ENV_FILE_EU ' # string. Required. Secure File.
2020
2121 - task : CopyFiles@2
22- displayName : ' copy asia backendend'
22+ displayName : ' copy europe backendend'
2323 inputs :
2424 SourceFolder : ' $(Agent.TempDirectory)'
25- Contents : BACKEND_ENV_FILE_ASIA
25+ Contents : BACKEND_ENV_FILE_EU
2626 TargetFolder : ' ./backend'
2727
28- - script : mv ./backend/BACKEND_ENV_FILE_ASIA ./backend/.env
29- displayName : ' rename asia .env'
28+ - script : mv ./backend/BACKEND_ENV_FILE_EU ./backend/.env
29+ displayName : ' rename europe .env'
3030 - task : DownloadSecureFile@1
31- displayName : ' download asia frontend'
31+ displayName : ' download europe frontend'
3232 inputs :
33- secureFile : ' FRONTEND_ENV_FILE_ASIA ' # string. Required. Secure File.
33+ secureFile : ' FRONTEND_ENV_FILE_EU ' # string. Required. Secure File.
3434
3535 - task : CopyFiles@2
36- displayName : ' copy asia frontend'
36+ displayName : ' copy europe frontend'
3737 inputs :
3838 SourceFolder : ' $(Agent.TempDirectory)'
39- Contents : FRONTEND_ENV_FILE_ASIA
39+ Contents : FRONTEND_ENV_FILE_EU
4040 TargetFolder : ' ./frontend'
4141
42- - script : mv ./frontend/FRONTEND_ENV_FILE_ASIA ./frontend/.env
43- displayName : ' rename asia .env'
42+ - script : mv ./frontend/FRONTEND_ENV_FILE_EU ./frontend/.env
43+ displayName : ' rename europe .env'
4444
4545 - script : ls -a ./frontend
4646 displayName : ' ls'
@@ -71,24 +71,24 @@ stages:
7171 archiveFile : $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
7272 replaceExistingArchive : true
7373 - upload : $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
74- artifact : drop_asia
74+ artifact : drop_eu
7575
76- - deployment : VMDeploy_ASIA
77- dependsOn : Build_asia
78- displayName : DEPLOY ASIA
76+ - deployment : VMDeploy_EU
77+ dependsOn : Build_europe
78+ displayName : DEPLOY EU
7979 environment :
8080 name : PROD
8181 resourceType : VirtualMachine
82- tags : asia
82+ tags : europe
8383 strategy :
8484 runOnce :
8585 preDeploy :
8686 steps :
8787 - task : DownloadPipelineArtifact@2
8888 inputs :
8989 buildType : ' current'
90- artifactName : drop_asia
91- targetPath : ' $(Pipeline.Workspace)/drop_asia '
90+ artifactName : drop_eu
91+ targetPath : ' $(Pipeline.Workspace)/drop_eu '
9292
9393 - script : echo initialize, cleanup, backup, install certs
9494
@@ -104,24 +104,16 @@ stages:
104104
105105 - task : ExtractFiles@1
106106 inputs :
107- archiveFilePatterns : ' $(Pipeline.Workspace)/drop_asia /$(Build.BuildId).zip'
107+ archiveFilePatterns : ' $(Pipeline.Workspace)/drop_eu /$(Build.BuildId).zip'
108108 destinationFolder : ' $(Pipeline.Workspace)/japp'
109109 cleanDestinationFolder : true
110110 overwriteExistingFiles : true
111111
112112 - task : DeleteFiles@1
113113 inputs :
114- SourceFolder : ' $(Pipeline.Workspace)/drop_asia '
114+ SourceFolder : ' $(Pipeline.Workspace)/drop_eu '
115115 Contents : ' $(Build.BuildId).zip'
116116
117- - task : Bash@3
118- inputs :
119- targetType : ' inline'
120- script : |
121- cd /home/azureuser/azagent/_work/2/japp
122- pm2 restart index
123- sudo systemctl restart nginx
124-
125117 routeTraffic :
126118 steps :
127119 - script : echo routing traffic
0 commit comments