Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child variables are not expanding correctly when parent is a server-only step #2899

Closed
Dalmirog opened this issue Nov 8, 2016 · 4 comments
Closed
Labels
Milestone

Comments

@Dalmirog
Copy link

@Dalmirog Dalmirog commented Nov 8, 2016

This one took me a while to figure out and I'm not 100% happy with the title or decription, so feel free to change them or ask my about it

Setup

  • 1 Environment

  • 2 Cloud regions on the environment (same happens with regular Tentacles)

    • Name North; Role North-Services
    • Name South; Role South-Services
  • 2 project Variables

    • Name Region; Value Canada ; Scoped to North-Services
    • Name Region; Value Argentina ; Scoped to South Services

Deployment Process

  • 1 parent Azure web app step that runs on behalf of North-Services & South-Services
    • An Azure PS child step with the code
    write-output "The value of [Octopus.Machine.Name] is: $($OctopusParameters['Octopus.Machine.name'])"
    write-output "The value of [Region] is: $region"

If you run the deployment like that, the Azure PS step will run once and neither Octopus.machine.name or Region will hold a value.

Now add a regular Powershell step as a child of the web app with the code write-output 'stuff'. Your deployment process should now look like this:

  • 1 parent Azure web app step that runs on behalf of North-Services & South-Services
    • An Azure PS child step with the code
    write-output "The value of [Octopus.Machine.Name] is: $($OctopusParameters['Octopus.Machine.name'])"
    write-output "The value of [Region] is: $region"
    • A regular PS script step with the code
     write-output 'stuff'

Once you deploy this, the variables Octopus.machine.name and region used in the Azure PS script will now hold the expected value.

Version: 3.4.15

@Dalmirog Dalmirog added the kind/bug label Nov 8, 2016
@markryd markryd self-assigned this Feb 16, 2017
@markryd

This comment has been minimized.

Copy link

@markryd markryd commented Feb 20, 2017

Okay, at the moment AzureActionDefinitionBase only sets MachineSelection.AllInTargetRoles if there is only a single action, no child actions. If you add a non-azure child action the whole lot gets upgraded to AllInTargetRoles. This is easy enough to fix, but would be a behavior change. Will get some more input from the team.

@markryd markryd closed this Feb 20, 2017
@octoreleasebot

This comment has been minimized.

Copy link

@octoreleasebot octoreleasebot commented Feb 20, 2017

Release Note: Fixed Azure steps not running for all targets in roles when there were multiple Azure child steps

@lock

This comment has been minimized.

Copy link

@lock lock bot commented Nov 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately.

@lock lock bot unassigned markryd Nov 25, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.