I’m using octopus old version 3.5 which do not have Run Condition option. So I came up with different solution to skip the build step ie., I’m throwing the (Write-Error “Skipped”) in my PreDeploy.ps1 which is stopping the execution of my build step and moving to next build step as expected but it stops the execution as error on octopus Task log in red text. And my questions are
1. Is it possible to display the Write-Error "Skipped" that was done in PreDeploy.ps1 with informative text style (ie., black text with the custom message).
2. Is there any neat way to do all this process of skipping
The short answer is that upgrading Octopus Deploy is the best solution here. There is no nice way to achieve what you need in the version of Octopus Deploy that you are currently using.
Is it possible to display the Write-Error “Skipped” that was done in PreDeploy.ps1 with informative text style (ie., black text with the custom message)?
The output of Write-Error will always be displayed as an error. There is no way to change how this appears in the log output.
Is there any neat way to do all this process of skipping?
The best way to implement this kind of process skipping is to upgrade to the latest version of Octopus Deploy. Implementing this functionality required changes to Octopus Deploy itself, and so there is no neat way to reimplement this functionality in older versions.
currently I don’t have an option with upgrading the version of octopus, as there are other projects that depend on the current version. Hope our company go with upgrading on octopus in future.
But at present I’m wondering what are my possibilities to skip the deployment step with octopus version 3.5.
As mentioned in the above question using Write-Error in PreDeploy.ps1 stop the invoking/execution on current step showing it as error and continues to the next step. which seems not correct as user may think there is an error in specific step.
So, can I improve the current situation or there are any other possibilities for skipping the step.