Why do our failing steps always seem to show as green!
For instance in our database deployment deploy.ps1 we have this code…
@@@
if($builtAgainstVersion -ne $currentDbVersion)
{
Write-Error “Destination Database is not the expected version: Expected=$builtAgainstVersion , Actual=$currentDbVersion”
[Environment]::ExitCode = -1
$LastExitCode = -1
exit -1
}
@@@
As you can see nothing seems to work…
We still get this in our output…
@@@
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: C:\Octopus\Applications\CS_Test\CentralServicesDB\1.2.0.105\Deploy.ps1 : Destination Database is not the expected
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: version: Expected=1.2.0.93 , Actual=
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: At C:\Octopus\Applications\CS_Test\CentralServicesDB\1.2.0.105\Bootstrap.6f649b87-e062-445a-b8d5-90391cc71302.ps1:342
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: char:1
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: + . "C:\Octopus\Applications\CS_Test\CentralServicesDB\1.2.0.105\Deploy.ps1"
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: + CategoryInfo : NotSpecified: ( [Write-Error], WriteErrorException
2013-07-18 14:13:43 INFO [Deploy Script] ERROR: + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Deploy.ps1
2013-07-18 14:13:43 INFO [Deploy Script] ERROR:
2013-07-18 14:13:43 WARN [Deploy Script] The script returned an exit code of 0, but output was written to the error output stream. Please investigate any errors in the script output above.
@@@
This is an issue we’ve brushed under the carpet since we started using Octopus that we’d like to get to the bottom of. Any ideas?
TIA,
Graeme