Octopus post-deploy script does not print "Write-Host" or "Write-Output" statements when invoked by Chain Deployment

The subject pretty much explains the issue I have. Neither “Write-Host” nor “Write-Output” statements
are printed when invoked as a Chain Deployment step template. They print just fine when a release of that project is directly deployed.

Hi,

Thanks for getting in touch! I’m sorry to hear you’re hitting this unexpected and strange issue. It might simply be something to do specifically with the Chain Deployment community step template you’re using. We have a built-in step that deploys a release of a different project like this called Deploy a Release (introduced in 2018.2.1). This is the step that we’d recommend using, and it also allows you to pass in variables from the “parent” project to the “child” project, and doesn’t require an API key, etc.

If you’re unable to switch to this new step, could you elaborate on your scenario to help us get a better understanding of what you’re trying to achieve? Are you using the Write-Host in the “child” project? If so, do you see the output of the Write-Host in the task log of the child’s deployment?

I hope this helps! Let me know how you go or if you have any further questions along the way. :slight_smile:

Best regards,

Kenny

Hi Kenneth,

Thank you for your response. We were using that step template at first, but we moved away from it because we were not able to create a new release. The Chain Deployment step template allowed us to always create a new release, and that’s why we switched to it.

Our exact setup is like this: we have n projects in a particular project group, and a separate project that deploys a release of all those n projects. We need to be able to create a new release when the Deploy All project is run. We found that when we had a project whose processes used the Deploy a Release step template, it was deploying the latest releases instead of creating a new one. This would not work when, for instance, we had updated some variables in the dependent projects.

The reason we need the Write-Host or Write-Output statements is because we want to print the values of certain variables during deployment in order to confirm that they were the same as when the dependent project is deployed on its own. When we deploy a release of just that project, things work fine, but something is going wrong when we use the Deploy All project (with the Chain Deployment step template) and a part of the post-deploy script does not get executed. As I mentioned earlier, our Deploy All project basically deploys a new release of all other projects. When we deploy a new release of the other project separately, the Write-Host or Write-Output line is executed and the logs show it. But in the Deploy All project, it does not.

We suspect that a common variable from a variable set is being updated with a certain value in one of the process steps, due to which it does not get updated in a future process step.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.