Skip to content

Commit

Permalink
Merge pull request #7 from delawarePro/dejonghee/smoketest-hooks
Browse files Browse the repository at this point in the history
Support staging and production slot validation
  • Loading branch information
dejonghee authored Jul 16, 2021
2 parents 928129f + 16262f1 commit 013b726
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions azure/pipelines/deploy/web-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ parameters:
type: string
displayName: "Optional label to prefix steps in pipeline."
default:
- name: postDeploySteps
- name: postStagingSteps
type: stepList
default: []
displayName: "Optional steps to execute after the deploy, before swapping slots (e.g. smoke testing)."
displayName: "Optional steps to execute after staging slot deploy, before swapping slots (e.g. smoke testing)."
- name: postDeploySteps
type: stepList
default: []
displayName: "Optional steps to execute after production slot deploy, before cleaning up the old slot (when applicable)."

steps:
- task: PowerShell@2
Expand Down Expand Up @@ -67,10 +71,14 @@ steps:
TakeAppOfflineFlag: false
condition: and(succeeded(), ne(variables['skipWebApp'], 'true'))

- ${{ each step in parameters.postDeploySteps }}:
- ${{ step }}

- ${{ if and(parameters.webAppSlot, eq(parameters.webAppSlot, 'production')) }}:
- ${{ each step in parameters.postDeploySteps }}:
- ${{ step }}

- ${{ if and(parameters.webAppSlot, ne(parameters.webAppSlot, 'production')) }}:
- ${{ each step in parameters.postStagingSteps }}:
- ${{ step }}

- task: AzureAppServiceManage@0
displayName: '${{ coalesce(parameters.label, parameters.module) }} - Swap slots'
inputs:
Expand All @@ -81,6 +89,9 @@ steps:
SourceSlot: ${{ parameters.webAppSlot }}
condition: and(succeeded(), ne(variables['skipWebApp'], 'true'), ne(variables['${{ parameters.variablePrefix }}${{ parameters.module }}WebAppSlot'], 'production'))

- ${{ each step in parameters.postDeploySteps }}:
- ${{ step }}

- task: AzureAppServiceManage@0
displayName: '${{ coalesce(parameters.label, parameters.module) }} - Remove slot'
inputs:
Expand Down

0 comments on commit 013b726

Please sign in to comment.