Skip to content

Commit

Permalink
Add Data persistence layer to mailhog
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenali committed Oct 24, 2020
1 parent a0a87e5 commit 7e2ade5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,11 @@ do_init_empty_data(){

do_drop_es_data
do_drop_data
do_drop_mailhog_data

do_create_data
do_create_es
do_create_mailhog
echo_info "Done"
}

Expand Down Expand Up @@ -1442,6 +1444,7 @@ do_deploy() {
do_create_es
do_create_onlyoffice
do_create_cmis
do_create_mailhog
if ${DEPLOYMENT_JITSI_ENABLED}; then
do_create_jitsi
fi
Expand All @@ -1462,6 +1465,7 @@ do_deploy() {
do_create_es
do_create_onlyoffice
do_create_cmis
do_create_mailhog
if ${DEPLOYMENT_JITSI_ENABLED}; then
do_create_jitsi
fi
Expand Down
9 changes: 9 additions & 0 deletions _functions_mailhog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ do_drop_mailhog_data() {
if [ "${DEPLOYMENT_MAILHOG_ENABLED}" == "true" ]; then
echo_info "Drops Mailhog container ${DEPLOYMENT_MAILHOG_CONTAINER_NAME} ..."
delete_docker_container ${DEPLOYMENT_MAILHOG_CONTAINER_NAME}
delete_docker_volume ${DEPLOYMENT_MAILHOG_CONTAINER_NAME}
echo_info "Done."
echo_info "Mailhog data dropped"
else
echo_info "Skip Drops Mailhog container ..."
fi
}

do_create_mailhog() {
if [ "${DEPLOYMENT_MAILHOG_ENABLED}" == "true" ]; then
echo_info "Creation of the Mailhog Docker volume ${DEPLOYMENT_MAILHOG_CONTAINER_NAME} ..."
create_docker_volume ${DEPLOYMENT_MAILHOG_CONTAINER_NAME}
fi
}

do_stop_mailhog() {
echo_info "Stopping Mailhog ..."
if [ "${DEPLOYMENT_MAILHOG_ENABLED}" == "false" ]; then
Expand All @@ -63,6 +71,7 @@ do_start_mailhog() {
-d \
-p "${DEPLOYMENT_MAILHOG_SMTP_PORT}:1025" \
-p "${DEPLOYMENT_MAILHOG_HTTP_PORT}:8025" \
-v ${DEPLOYMENT_MAILHOG_CONTAINER_NAME}:/maildir \
--name ${DEPLOYMENT_MAILHOG_CONTAINER_NAME} ${DEPLOYMENT_MAILHOG_IMAGE}:${DEPLOYMENT_MAILHOG_IMAGE_VERSION}
echo_info "${DEPLOYMENT_MAILHOG_CONTAINER_NAME} container started"

Expand Down

0 comments on commit 7e2ade5

Please sign in to comment.