GFlisch / Arc4u.Guidance.Doc

Other
5 stars 1 forks source link

AzureDevOps script DatabaseUpdateMigrationTool.ps1 does not handle migrationtools return code #184

Closed rdarko closed 1 year ago

rdarko commented 1 year ago

Is your feature request related to a problem? Please describe. The script DatabaseUpdateMigrationTool.ps1 does invoke the migration tool by using invoke-expression however this gives no way to obtain the return code of the migration tool in case the tools does encounter an error. This leads to issues with the pipeline in a release where the migration tool does encounter an issue and the release pipeline does still continue the deployment, resulting in an incomplete release and undefined behavior that is extreamly hard to debug as the pipeline step still reports "OK" while only showing in its logfiles any possible error.

Describe the solution you'd like The DatabaseUpdateMigrationTool.ps1 should obtain the processes return code and invalidate the current azure dev ops step in the pipeline like this: `$returnCode = invoke-expression "$cmd $arguments; $?"

if(-not $returnCode) { Write-Host "MigrationTool execution failed." exit -1; }`

Additional context Guidance Version 2022.2.1

Creted together with JP Bachmann

rdarko commented 1 year ago

will be done in the devops team. The ticket is on their dedicated board