Reputation: 18068
I've got a deployment release (A) and E2E test run release (B). I cannot merge them. Can I somehow set B release run after given stage in A release completes?
Upvotes: 2
Views: 1236
Reputation: 35119
Agree with Shayki Abramczyk.
I would like to share the Powershell script sample and other extensions.
Powershell script to trigger the release:
Here is the powershell script example:
$VSTSAccoutName="organiztionname"
$teamProjectName="projectname"
$personaltoken = " PAT "
$ReleaseMetadata = '{"definitionId": 15 }';
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($personaltoken)"))
$header = @{authorization = "Basic $token"}
$Uri = 'https://vsrm.dev.azure.com/' + $VSTSAccoutName +'/'+ $teamProjectName + '/_apis/release/releases?api-version=5.0'
$ReleaseResponse = Invoke-RestMethod -Method Post -ContentType application/json -Uri $Uri -Body $ReleaseMetadata -Headers $header
Write-Host $ReleaseResponse
You could add the powershell task in the Release A -> Target stage
.
Other extensions: Release Orchestrator extension
This extension also supports selecting to trigger the stages specified in release B.
Upvotes: 4
Reputation: 41545
You can use the VSTS Creare Release Task extension:
Creates a new release as part of the current release pipeline.
So, add it in the last step of deployment release (A).
Upvotes: 2