@@ -32,14 +32,14 @@ extends:
3232 variables :
3333 - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }} :
3434 - name : isOfficialBuild
35- value : true
35+ value : True
3636 - name : deploymentSlot
3737 value : staging
3838 - name : storageAccount
3939 value : netsourceindex
4040 - ${{ else }} :
4141 - name : isOfficialBuild
42- value : false
42+ value : False
4343 - name : deploymentSlot
4444 value : validation
4545 - name : storageAccount
@@ -200,28 +200,29 @@ extends:
200200 }
201201 displayName: Test Deployed WebApp
202202
203- - ${{ if eq(variables['isOfficialBuild'], true) }} :
204- - task : AzureCLI@2
205- displayName : Swap Staging Slot into Production
206- inputs :
207- azureSubscription : SourceDotNet-Deployment-ARM
208- scriptLocation : inlineScript
209- scriptType : ps
210- inlineScript : >
211- az webapp deployment slot swap
212- --resource-group source.dot.net
213- --name netsourceindex
214- --slot staging
215- --target-slot production
216-
217- - task : AzureCLI@2
218- displayName : Cleanup Old Storage Containers
219- inputs :
220- azureSubscription : SourceDotNet-Deployment-ARM
221- scriptLocation : inlineScript
222- scriptType : ps
223- inlineScript : >
224- deployment/cleanup-old-containers.ps1
225- -ResourceGroup source.dot.net
226- -WebappName netsourceindex
227- -StorageAccountName $(storageAccount)
203+ - task : AzureCLI@2
204+ displayName : Swap Staging Slot into Production
205+ condition : eq(variables['isOfficialBuild'], 'True')
206+ inputs :
207+ azureSubscription : SourceDotNet-Deployment-ARM
208+ scriptLocation : inlineScript
209+ scriptType : ps
210+ inlineScript : >
211+ az webapp deployment slot swap
212+ --resource-group source.dot.net
213+ --name netsourceindex
214+ --slot staging
215+ --target-slot production
216+
217+ - task : AzureCLI@2
218+ displayName : Cleanup Old Storage Containers
219+ condition : eq(variables['isOfficialBuild'], 'True')
220+ inputs :
221+ azureSubscription : SourceDotNet-Deployment-ARM
222+ scriptLocation : inlineScript
223+ scriptType : ps
224+ inlineScript : >
225+ deployment/cleanup-old-containers.ps1
226+ -ResourceGroup source.dot.net
227+ -WebappName netsourceindex
228+ -StorageAccountName $(storageAccount)
0 commit comments