Skip Step When Auto Deploying When Machine Becomes Available for Deployment?

daniel.auger's Avatar

daniel.auger

12 Oct, 2017 06:20 PM

We have a project with an automatic deployment trigger for the "Machine becomes available for deployment" event group. Ideally we'd like to skip a step in our deployment process if the deployment is triggered by this event. Is there a way to do this? It looks like we might be able to do this using an expression in the step's run condition, but I'm unsure of the exact syntax to use if this is possible.

Is this possible? If so, what is the syntax?

  1. Support Staff 1 Posted by Tom Peters on 13 Oct, 2017 12:30 AM

    Tom Peters's Avatar

    Hi,
    Thanks for getting in touch!

    We don't expose any special variables during deployment that can be used to determine how the deployment was triggered. This means you can't use a custom expression for a step's run condition to disable it based on how it was triggered.

    We currently don't allow this because deployments usually should be treated the same regardless of how they are triggered. Could you tell me a little more about why you have a step that you want to disable if the deployment was automatically triggered by a specific event? The reason I am asking is because there may be other ways of solving your specific problem.

    As a workaround, you could clone your project and remove this step from the cloned project. You could add the automatic deployment trigger for the "Machine becomes available for deployment" event group to this cloned project and remove this trigger from the original project. This is probably not a good option for a variety of reasons, but if you have a relatively simple setup it might work for you.

    Regards,
    Tom

  2. 2 Posted by daniel.auger on 13 Oct, 2017 06:08 PM

    daniel.auger's Avatar

    Hi Tom,

    It is good to know for future reference that there is not a way to figure out what triggered the deployment. I do agree with the overall philosophy that it shouldn't matter.

    After reading your reply, I re-read the Automatic Deployment Triggers documentation a few times until scoping / targeting clicked with me. I can indeed solve my issue simply through scoping steps to specific roles.

    Much appreciated, Thanks!

  3. 3 Posted by Cali LaFollett on 05 Dec, 2017 06:55 PM

    Cali LaFollett's Avatar

    I am actually interested in this same situation. We have a step in place to verify all new releases to our production environment but also have auto scaling events where a server may be taken off or pulled back online to support high traffic loads.

    In the event of a scale up event, we do not want out already approved and deployed release to go through a Manual Intervention step during scale up event. Since the release was already approved, no need to approve it again.

    I was going to create a Variable expression Run Condition on ours step and noticed some new Octopus variables which might help my cause but I can't find any reference to these variables anywhere in the Octopus documentation as to how they should be used:

    * Octopus.ProjectTriggerCondition.Environments
    * Octopus.ProjectTriggerCondition.EventCategories
    * Octopus.ProjectTriggerCondition.EventGroups
    * Octopus.ProjectTriggerCondition.Roles

    It seems I could be able to see if the trigger was caused by a specific event group????

    Any help here would be greatly appreciated...

  4. Support Staff 4 Posted by Tom Peters on 05 Dec, 2017 11:52 PM

    Tom Peters's Avatar

    Hi,

    We have a section in our docs that describes a workaround for this exact scenario (disabling manual interventions during automatically triggered deployments).

    Let me know if that doesn't make sense or if you need any more help.

    Regards,
    Tom

  5. 5 Posted by Cali LaFollett on 06 Dec, 2017 02:18 PM

    Cali LaFollett's Avatar

    Thanks for the response Tom.

    I did find that but the work around was not very clear. I think we did end up figuring it out but it's not an optimal solution. We are lucky to have a single server which we can apply the "manual" role to work around this.

    Having a baked in way to deal with this would be much better.

    Cali

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