Skip to content
Snippets Groups Projects
Commit cb90628f authored by jurgenhaas's avatar jurgenhaas
Browse files

composer/plugin/docker4drupal#64 Add support for mailpit

parents
Branches main
No related tags found
No related merge requests found
LICENSE 0 → 100644
The MIT License (MIT)
Copyright (c) 2015, 2016 Jürgen Haas, PARAGON Executive Services GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
# file: roles/mailpit/handlers/main.yml
- name: Add MailPit to Boot-List
systemd:
name: mailpit
state: started
daemon_reload: yes
enabled: yes
---
# file: roles/mailpit/tasks/install.yml
- name: Download MailPit
unarchive:
src: 'https://github.com/axllent/mailpit/releases/download/v1.12.1/mailpit-linux-386.tar.gz'
dest: /usr/bin
remote_src: yes
- name: Start script
template:
src: etc_init_d_mailpit
dest: /etc/init.d/mailpit
mode: 0755
notify:
- Add MailPit to Boot-List
---
# file: roles/mailpit/tasks/main.yml
- name: Common MailPit
set_fact:
role_mailpit_started: yes
tags:
- always
- block:
- name: Import install
import_tasks: install.yml
- name: Remember that this role had been run
set_fact:
role_mailpit_completed: yes
tags:
- always
when: (not excluded_roles or "mailpit" not in excluded_roles) and role_mailpit_completed is not defined
#!/bin/sh
### BEGIN INIT INFO
# Provides: mailpit
# Short-Description: Start and stop mailpit mail server
# Description: mailpit mail server
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Action to take
case "$1" in
start)
echo "Starting mailpit ..."
/usr/bin/mailpit >> /var/log/mailpit.log &
exit 0
;;
stop)
echo "Stopping mailpit ..."
kill `pidof /usr/bin/mailpit` && echo "mailpit stopped"
exit 0
;;
*)
echo "Usage: service mailpit {start|stop}"
exit 1
;;
esac
exit $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment