I cannot succeed to propagate my output variable from the step to following Steps. Issue is that all following Steps are basically Releases of some other Projects.
I have Project1 and Step1 with variable: Set-OctopusVariable -name “AppServer1” -value "Test"
If I try to print that in following step everything works OK! Write-Host($OctopusParameters[“Octopus.Action[DiscoverHostnames].Output.AppServer1”])
But if I want to print that in following step which is actually a Step -> Other -> Deploy a Release
I am not getting anything
Can it be retrieved somehow in next step which is the Release? I have 10 next steps which are the releases so I would not like to repeat the logic for retrieving the Output Variable.
I read also on https://octopus.com/docs/projects/variables/output-variables
chapter Output from deploy a release steps ( Octopus.Action[Deploy Web Project].Output.Deployment[Update IP Address].IPAddress) but that is opposite direction from what I need.
I need direction from Step to Deploy a release step, but that explains just the directions from Deploy a release step to following Step.
Please if someone knows how to achieve this, I read a lot about Octopus output variables and still cannot find a way how to resolve this.
Could you provide me with more details about how you are trying to use this variable in “Deploy a Release” steps? Are you trying to call this variable in a pre/post deploy script?
thanks for your envolvement.
So I have Project1 and in Step1 I am setting the output variables.
In Step2 I select Other - > Deploy Release (and in that select Project2) and in the first Step of that project2 I am trying to retrieve the value for output variables from the Project1 where Project2 is the child project for the Project1.
So in that following step, on the level of the Project2 step I am trying to retrieve the value by using the: Write-Host($OctopusParameters[“Octopus.Action[DiscoverHostnames].Output.AppServer1”])
but I am not getting anything as value.
But I really need to retrieve the value within my following step - that is actually a release of some other project.