I am pulling down my own docker image from docker hub in bitbucket pipelines and would like to send mail from within the docker image
I am using mail command and everything works fine when running the docker image on my own computer. I am using gmail as the mail provider.
but when I do the same in pipeline it does not work. I don't get any error message or anything so that I would see what is actually wrong
I tried to put the debug logs on on the mail command but I don't get any output in pipeline
on my local laptop (wls2 on windows), I get some debug log output and like said before it works fine
Any ideas what's wrong ?
Thank you for your question!
Usage example for your custom pipe could be the next:
- pipe: docker://your-repository/your-custom_email-image:latest
Also, we have open-sourced email-notify pipe,
so you could see how it build or use it just adding the next configuration to your pipeline:
scripts: - pipe: atlassian/email-notify:0.4.3 variables: USERNAME: 'firstname.lastname@example.org' PASSWORD: $PASSWORD FROM: 'email@example.com' TO: 'firstname.lastname@example.org' HOST: 'smtp.gmail.com'
Thanks for the info, I have tried that email-notify pipe and it works fine but the problem I have is that I am running pmd and I want to send the result in the email body
I couldn't figure out how to expose the result to the email-notify so I decided to do the email sending from within the docker image also
Do you have any idea why the email sending does not work ? It works find if I log into the image and run the analysis and then send the result from my own laptop. In this case the host where the image is run is of course is different than in the pipeline
Does anyone have any luck sending mail from within a docker image ? I am running within the docker image pmd analysis, generating a html file and then sending the result with mail.
This all works fine on my own laptop but not in pipeline. The pmd analysis runs fine but not the mail sending. There are no errors. I tried putting on the debug levels for the mail command but it does not debug anything. When I run the mail command on my laptop within the docker image I get the debug statements.
It seems issuing that mail command within the docker image does not work at all, anyone have any experience with the same ?
Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events