From dc54e640c296d50c51858fa50256b3aed9e0a46c Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Tue, 17 Jan 2017 15:01:41 +0100 Subject: Add inbucket docker image to allow local and automated testing of emails (#4901) * add docker container for inbucket * Add way to get the emails using inbucket and add a test for reset password * add config setting to send emails * update TestEmailTest update * add another test and fix wrong assert * update per review fix lint change senders email * Revert config.json to default values for EmailSettings section * update test * add setup to make the test run --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b4d243fdf..980a9b89d 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,14 @@ start-docker: docker start mattermost-webrtc > /dev/null; \ fi + @if [ $(shell docker ps -a | grep -ci mattermost-inbucket) -eq 0 ]; then \ + echo starting mattermost-inbucket; \ + docker run --name mattermost-inbucket -p 9000:10080 -p 2500:10025 -d jhillyerd/inbucket:latest > /dev/null; \ + elif [ $(shell docker ps | grep -ci mattermost-inbucket) -eq 0 ]; then \ + echo restarting mattermost-inbucket; \ + docker start mattermost-inbucket > /dev/null; \ + fi + ifeq ($(BUILD_ENTERPRISE_READY),true) @echo Ldap test user test.one @if [ $(shell docker ps -a | grep -ci mattermost-openldap) -eq 0 ]; then \ @@ -132,6 +140,11 @@ stop-docker: docker stop mattermost-webrtc > /dev/null; \ fi + @if [ $(shell docker ps -a | grep -ci mattermost-inbucket) -eq 1 ]; then \ + echo stopping mattermost-inbucket; \ + docker stop mattermost-inbucket > /dev/null; \ + fi + clean-docker: @echo Removing docker containers @@ -159,6 +172,12 @@ clean-docker: docker rm -v mattermost-webrtc > /dev/null; \ fi + @if [ $(shell docker ps -a | grep -ci mattermost-inbucket) -eq 1 ]; then \ + echo removing mattermost-inbucket; \ + docker stop mattermost-inbucket > /dev/null; \ + docker rm -v mattermost-inbucket > /dev/null; \ + fi + check-client-style: @echo Checking client style @@ -303,6 +322,12 @@ package: build build-client @# Disable developer settings sed -i'' -e 's|"ConsoleLevel": "DEBUG"|"ConsoleLevel": "INFO"|g' $(DIST_PATH)/config/config.json + @# Reset email sending to original configuration + sed -i'' -e 's|"SendEmailNotifications": true,|"SendEmailNotifications": false,|g' $(DIST_PATH)/config/config.json + sed -i'' -e 's|"FeedbackEmail": "test@example.com",|"FeedbackEmail": "",|g' $(DIST_PATH)/config/config.json + sed -i'' -e 's|"SMTPServer": "dockerhost",|"SMTPServer": "",|g' $(DIST_PATH)/config/config.json + sed -i'' -e 's|"SMTPPort": "2500",|"SMTPPort": "",|g' $(DIST_PATH)/config/config.json + @# Package webapp mkdir -p $(DIST_PATH)/webapp/dist cp -RL $(BUILD_WEBAPP_DIR)/dist $(DIST_PATH)/webapp -- cgit v1.2.3-1-g7c22