I have an Octopus deployment that deploys to two machines with different roles. In one of the steps, a package is deployed to both machines (i.e. to machines with both roles). The next step, also executed on both machines, sets an output variable.
When both targets have normal octopus tentacles installed, no problem. However, I experimented with offline package drop for ONE of the two targets, and found that the installation failed because a path to a package was incorrect. It turned out that the script was attempting to access the package installation directory for the other target, and that the output variable scoped to the offline machine had somehow been lost between steps. Mujltiple values were available (for both targets), as expected, in one step, and then gone after the next (OctopusPrintEvaluatedVariables = true)…
I’ve extracted (and anonomised) the output variables corresponding to the problem step from the deployment output, and shown how the values for the current deployment target are lost, below:
Step 7:
[Octopus.Action[Deploy CI additional resources].Output.Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_7’
[Octopus.Action[Deploy CI additional resources].Output.Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output.Package.InstallationDirectoryPath] = ‘Path_to_package\31_7’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE1].Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package31_7’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE1].Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE1].Package.InstallationDirectoryPath] = ‘Path_to_package\31_7’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
Step 8:
[Octopus.Action[Deploy CI additional resources].Id] = ‘cae7c6b5-e1ec-41a7-8ee1-b96aff131720’
[Octopus.Action[Deploy CI additional resources].Name] = ‘Deploy CI additional resources’
[Octopus.Action[Deploy CI additional resources].Number] = ‘6’
[Octopus.Action[Deploy CI additional resources].Output.Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output.Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Octopus.Action.Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.ExtractedFileCount] = ‘18’
[Octopus.Action[Deploy CI additional resources].Output[MACHINE2].Package.InstallationDirectoryPath] = ‘Path_to_package\31_14’
Note the final folder number was different on the two machines - hence the deployment failed as it was looking for the folder from MACHINE2 when it should have been looking for the folder from MACHINE1
Seems like a bug to me…