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

Octopus.Environment.Name not evaluated when manually running a step template from library #3725

Closed
alexrolleyoctopus opened this issue Aug 9, 2017 · 4 comments
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving
Milestone

Comments

@alexrolleyoctopus
Copy link

To replicate issue:

  • Create a step template based off default script template
  • Add code to evaluate system variable $EnvironmentName = $OctopusParameters['Octopus.Environment.Name']
  • Manually run script template
  • Select Run the script on all deployment targets in set of environments and roles
  • Limit it to an Environment
  • Select run now

You will notice that the variable evaluates to null, whereas the same code when run as a script step in a project will correctly report the Environment.

@alexrolleyoctopus alexrolleyoctopus added area/execution kind/bug This issue represents a verified problem we are committed to solving labels Aug 9, 2017
@hnrkndrssn hnrkndrssn self-assigned this Aug 9, 2017
@octoreleasebot octoreleasebot added this to the 3.16.3 milestone Aug 18, 2017
@octoreleasebot
Copy link

Release Note: Add help text to environment selector on Run Step template page to make it clear no environment variables are available

@stanislavhordiyenko
Copy link

Interesting solution to solve the issue 👎

@hnrkndrssn
Copy link

hnrkndrssn commented Aug 18, 2017

Hi @stagor,

The release note doesn't have the full explanation of the solution that we have put in, the reason that we only added a note about no environment variables being available is due to that the Run step template feature is based on the Script console feature and by design these scripts are only run in the context of a machine, so unfortunately we don't have access to any environment variables.

My apologies for the inconvenience caused.

Thank you and kind regards,
Henrik

@lock
Copy link

lock bot commented Nov 24, 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 locked as resolved and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

4 participants