I'm using bitbucket pipelines and the email-notify plugin at:
https://bitbucket.org/atlassian/email-notify/src/master/
I have this working in a bitbucket pipeline as far as it goes. The intent here is to send emails to a mailing list/group/alias and not just the committer.
The documentation is however very quiet about a number of things. For example: when are emails sent? every build? build success? build failure? Only on state (fail/success) changes? How do we control this? Where is that documented?
I thought it only sent on build failure but that does not seem to be true. Also it would be very helpful if it was possible to send the same email content as is sent with the existing build failure email to the committer.
It would also be useful to have the build log available as an environment variable, a file, or really anything which it would be possible to include in the email. I realize we can do this by using redirection on the pipelines step script shell so this is not really a blocker, more of a usability issue.
In essence, we have a isolated email pipe without any way of integrating it to the build state (preferably only send emails on state change), the build log, the already styled and generated emails which are sent by bitbucket etc. I think this integration could use some more work.
If I had to choose one question I guess it would be: How do I send emails only on build failure?
What's wrong with using built-in e-mail notifications for the repository?
What you are using is a custom-pipe, so it will send emails whenever your pipeline definition step is executed according to your YAML definition file.
That is true, but I have not been able to figure out a way to send those notifications to an email group/alias/list. This pipeline is run in an enterprise context where it is not enough to send the email to the committer and we need a way to control who gets the email.
If there is a way to configure the normal notifications to be sent to an email group then that would work as a solution to this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it, I don't think it's currently possible, I'm using Slack notification for failed builds in such cases.
The condition would be perfect for this, however it is not supporting it at the moment according to documentation.
Maybe one of the maintainers of the email-notify pipe will see this and add an ENABLED flag to the pipe, but I don't see even a variable that could be used for controlling this.
Alternatively... you could create your own pipe, basing on the official email-notify one and extend it somehow to run conditionally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, I stand corrected, here's a complete example how to do it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mind posting that as an answer and I'll mark it as accepted? That is perfect for my needs and solves my problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.