Send only one email notification after all projects being deployed

Hi Octopus Team,

Currently Octopus Deploy supports sending email in a step of a project. However I would like to send only one email notification after all specified projects (ProjectA, ProjectB etc…) are being deployed. Is there a way to do this?

Thanks in advance

Hi Jian,

Thank you for getting in touch. There is no built in way to execute an action that depends on more than one project.
You have several options though:

  1. If you are initiating the deployments programatically, use the API to monitor the tasks and then send the email when the tasks complete
  2. Use the http://docs.octopusdeploy.com/display/OD/Subscriptions feature to trigger some code whenever a deployment completes that sends an email if the correct projects have been deployed.
  3. Poll the API to determine if the conditions to send an email have been met
  4. Add a script at the end of each deployment that checks to see if the conditions have been met.

I will writing up a more detailed overview of how to use these options sometime this week, I’ll let you know when that is done.

Regards,

Robert W

Hi Robert,

Thanks for the suggestions, any update on the detailed overview of How-To?

Regards,

jian

Hi Jian,

I am currently working on it. If you expand a bit more on your requirements, I’ll try and add in something addressing it.

Do you kick off all your deployments at the same time?
If not, what criteria do would you use to say all the projects have deployed?
What happens if a deployment fails?
What is the root motivation for doing this?

Robert W

Hi Robert,

Do you kick off all your deployments at the same time?
We kick off deployments not at the same time, but they all should be deployed within one hour duration (the beginning of first deployment to the end of last deployment).

If not, what criteria do would you use to say all the projects have deployed?
Currently we receive all the email notifications for all deployments, and manually verify if all the required deployments have been successfully deployed.

What happens if a deployment fails?
If a deployment failed, other deployment should still continue, and in the end, there should be an email notification to show all the deployments’ results.

What is the root motivation for doing this?
Each new daily build consists of many components (web services, user interfaces etc…), and each of the components has a stand alone project (aka. one component one project). This is the reason why I only want one email notifications for all deployments (projects).

Thank you

Jian

Hi Jian,

Thanks for that. One further question on “We kick off deployments not at the same time, but they all should be deployed within one hour duration (the beginning of first deployment to the end of last deployment).”

What event would trigger an email being sent? ie, what is the “rule” to say that the email show now be sent and not wait for further deployments to start?

Robert W

Hi Robert,

We have a daily build which consists of many components (projects), and they will be deployed as soon as the nuget packages pushed to Octopus server, which it wont be necessary that all the nuget packages being pushed at the same time. I want an email notification to notify me after all the projects being deployed (either failed or succeed).

Daily build scenario 1:
ProjectA deployed at 6:00PM - succeed.
ProjectB deployed at 6:15PM - failed.
ProjectC deployed at 7:00OM - succeed.
Trigger an email notification to indicate the build is failed.

Daily build scenario 2:
ProjectA deployed at 6:10PM - succeed.
ProjectC deployed at 6:20PM - succeed.
ProjectB deployed at 6:40PM - succeed.
Trigger an email notification to indicate the build is succeed.

Hope that clarifies my question :slight_smile:

Thanks,

Jian

Hi Jian,

Thanks. In other words, you want the workflow to start when any of the projects starts deploying. Then you want it to monitor the projects and send an email when they have all deployed, or within an hour, whichever is the earlier.

I’ll put something along those lines in.

Robert W

Hi Robert,

That is correct, except it doesn’t have to be within one hour, that was just an example.
Thanks for your effort.

Regards,

Jian

Hi Jian,

It took me a while, but I’ve done up that document: http://docs.octopusdeploy.com/display/OD/Coordinating+Multiple+Projects

Hope that helps,

Robert W

Hi Robert,

This is an awesome guide, it will be very useful. I will give it a try when I have a chance. Thank you very much.

Regards,

Jian