dataplat / dbops

⚙ dbops - Powershell module that provides continuous database deployments on any scale
MIT License
163 stars 39 forks source link

running devops module from Azure DevOps #163

Closed filippovichv closed 1 month ago

filippovichv commented 1 year ago

i am running command from my yml file

pwsh: |

    try { Install-DBOScript -ScriptPath "$(Pipeline.Workspace)\${{ parameters.ArtifactName }}\Migrations\DeploymentScripts" -SqlInstance "${{ parameters.DBServer }}"  -Database "${{ parameters.DBName }}"
         }
    catch {
    Write-Host "An error occurred:"
    Write-Host $_
    }

Script get executed fine ( i see changes in database ) however I keep getting error right after image Any suggestions?

nvarscar commented 1 year ago

Things I would try:

Aside from that there seem to be some suggestions to explicitly specify exit code for Azure tasks in the SO question: https://stackoverflow.com/questions/63508364/azure-devops-reports-powershell-task-as-passed-even-with-non-0-exit-code

filippovichv commented 1 year ago

Thank you ... The Install command is successful and that's why its surprising that i am getting exit code 1. Adding Exit 0 as suggested in ticket -works and it seems to catch SQL error or connection error if they exists , guess i ll proceed with this suggestion