Run Condition: Variable

mike.jacobs's Avatar

mike.jacobs

15 Feb, 2017 01:38 PM

We have started using the "Run condition: only run when the variable expression is true" as a way to control whether a step should run based on a combination of Tenants and Environments (since the list of valid Tenants is different in each Environment, I cannot simply add a Tenant Group filter on the step, but need the greater flexibility of an Octo Variable.)

However, this has the unfortunately side-effect of the step running ONLY based on the variable; it no longer cares whether earlier steps ran successfully or not (since selecting Run condition:Variable is unselecting the Success or Failure choices.)

This is a problem for us, in that these steps are now running even when there has been a failure in an earlier step, which we do not want.

What we need is either: make Run condition: Variable separate from Run condition: Success/Failure/Always; or create new entries SuccessAndVariable, FailureAndVariable.

Thanks for your help.

  1. Support Staff 1 Posted by Henrik Andersso... on 17 Feb, 2017 12:31 AM

    Henrik Andersson's Avatar

    Hi Mike,

    Thanks for getting in touch and for the suggestion!

    We've raised this issue to have your suggestion implemented.

    Again, many thanks for the suggestion.

    Thank you and best regards,
    Henrik

  2. 2 Posted by chris.camburn on 17 Feb, 2017 01:24 AM

    chris.camburn's Avatar

    As a workaround for anyone who needs it, until this gets added, the following will work:

    To run only on success and variable truthiness:

    #{unless Octopus.Deployment.Error}#{PromptedVariable}#{/unless}

    To run only on failure and variable truthiness:

    #{if Octopus.Deployment.Error}#{PromptedVariable}#{/unless}

  3. Support Staff 3 Posted by Henrik Andersso... on 17 Feb, 2017 01:38 AM

    Henrik Andersson's Avatar

    Thanks Chris for posting that workaround!

    Many thanks,
    Henrik

  4. 4 Posted by mike.jacobs on 17 Feb, 2017 04:10 PM

    mike.jacobs's Avatar

    Thanks.

    I found that work-around on the board shortly after posting. It works, but I'd still want the more direct way of doing on the step.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac