We are running script on Octopus Server where we
- Add process step to read data from DB and based on deployment environment find machines id’s and create output variable for each machine (This of this as producer running on Octopus Server)
- Add process to consume output data generated in Step #1 and run it on deployment servers.
Step #1 looks something like
for ($i=0; $i -lt $machinesCount; $i++)
$dataJson= $dataJson[$i] | ConvertTo-Json
Set-OctopusVariable -name $machines[$i].Id -value $dataJson
Step #2 looks something like
$machineId = $OctopusParameters[“Octopus.Machine.Id”]
$octopusMachineId = “Octopus.Action[Producer].$machineId”
If I hard code machine id like “Octopus.Action[Producer].Output.Machines-277” I do see value. But I want to bind “Machines-277” dynamically based on where deployment is happening.
WORKS FINE (HARDCODED):
How can I get output variable with dynamic value decided runtime? Please help me here.