There is a new parameter in the "CICDTemplate.yaml" that allows to define custom post-release steps in the CD stage for each environment. The parameter is defined in the environments collection parameter and is called "postReleaseSteps". The parameter is of type "stepList" and allows for standard YAML task/step syntax. This parameter can be used in the "CICD.yaml" file to plug custom tasks after the release of the deployment package. The custom steps are defined per environment and only an allowed list of task types can be used. The allowed task types as of this moment are:
See an example below for a custom post-release task to run web tests based on an artifact called 'tests' produced in the CI stage:
extends:
template: CICDTemplate.yaml@SitefinityCloudPipelines
parameters:
environments:
- name: 'Staging'
postReleaseSteps:
- task: DownloadPipelineArtifact@2
displayName: 'Download tests'
inputs:
source: 'current'
artifact: 'tests'
- task: VisualStudioTestPlatformInstaller@1
displayName: 'Visual Studio Test Platform Installer'
inputs:
versionSelector: 'latestStable'
- task: VSTest@2
displayName: 'VsTest - testAssemblies'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(Pipeline.Workspace)'
runTestsInIsolation: true
codeCoverageEnabled: true
testRunTitle: 'Default Test Run'
diagnosticsEnabled: true
vsTestVersion: 'toolsInstaller'