edbizarro / gitlab-ci-pipeline-php

:coffee: Docker images for test PHP applications with Gitlab CI (or any other CI platform!)
https://hub.docker.com/r/edbizarro/gitlab-ci-pipeline-php
MIT License
528 stars 166 forks source link

Sending emails #99

Open GlennM opened 4 years ago

GlennM commented 4 years ago

Hi,

I'm running unit tests via PHPUnit on GitLab CI and I do get the following error: sh: 1: /usr/sbin/sendmail: not found

In this case, I don't need any real email to be send. What would be the best way to incorporate this (e.g. combine MailHog with this Docker image)? Any other suggestions?

Thanks

edbizarro commented 4 years ago

You can setup mailhog or similar (maildev) as a service, but i don't know if this is possible on gitlab-ci, i myself never used for this purpose. If you are in Laravel you can use the LOG driver

snim2 commented 4 years ago

+1 for the Laravel log driver, or perhaps you could mock sendmail in your unit tests?

GlennM commented 4 years ago

Thanks for your replies.

I am familiar with Laravel, but this is a non-Laravel project.