Confirmation email steps with dynamic instances and polling tentacles

Hi There

Our process steps typically end with “Send confirmation email”. So, after successful deploys, an email is sent and everyone is happy :smile:

However, recently we have moved away from having fixed application and web servers into having dynamic ones in Google Compute Engine.

We are using an auto scaled “instance group” which creates and destroys servers from an image we have defined.

Our base image is simple containing no software. Instead, it configures itself as a polling tentacle on boot and grabs the deployments it needs from 8pus.

This all works great, except that, due the the “send confirmation email” step in our process, we now get emails every time a new dynamic instance is created, despite the fact its not a new deploy.

We really only want an email after the initial successful deploy (of a new version).

Do you have any advice on how to achieve this?

We’re using 8pus version 2018.3.8

Many thanks in advance!

Hi Richard

Thanks for getting in touch. I have a couple possible solutions for your scenario.

  1. Set step Run Condition by using Octopus system variables e.g. only run the email step if Octopus.Release.CurrentForEnvironment.Number is not the same as Octopus.Release.Number. Here is a sample Run condition for the email step #{if Octopus.Release.Number!=Octopus.Release.CurrentForEnvironment.Number}true#{/if}
    You can get more details about Run condition from this link

  2. Alternatively if you have a static target which is available during the initial deployment, you could add a role to the target e.g. email and scope your email step to that role. By doing this, the email step will only run on the static target as none of the other dynamic targets would have that role.
    This option might be a tricky if you are using our builtin Send email step as it only runs on server. The work around is to set up a script step as the parent and get it runs on target, you then add the email step as the child step.

I hope this helps!

Let me know what you think and how to go.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.