From 1bae93f340de9b574738dfea54aeb7496ae2d0c3 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Fri, 4 Jan 2019 14:29:28 +0200 Subject: [PATCH 1/9] Updated dockerfile by using `exec` --- docker/mjml-tcpserver/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/mjml-tcpserver/Dockerfile b/docker/mjml-tcpserver/Dockerfile index bb9fe4a..8c44a6a 100644 --- a/docker/mjml-tcpserver/Dockerfile +++ b/docker/mjml-tcpserver/Dockerfile @@ -15,4 +15,4 @@ ENV MJML_ARGS="--mjml.minify=true --mjml.validationLevel=strict" EXPOSE 28101 -ENTRYPOINT ["/bin/sh", "-c", "node tcpserver.js $MJML_ARGS --host=$HOST --port=$PORT"] +ENTRYPOINT ["/bin/sh", "-c", "exec node tcpserver.js $MJML_ARGS --host=$HOST --port=$PORT"] From d36c2ba8fbbe217c5d275d1411e69f3dd9cfde5b Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Fri, 4 Jan 2019 14:30:50 +0200 Subject: [PATCH 2/9] Updated tcp-server adding cleanly termination --- mjml/node/tcpserver.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/mjml/node/tcpserver.js b/mjml/node/tcpserver.js index f8a23ff..04277c1 100644 --- a/mjml/node/tcpserver.js +++ b/mjml/node/tcpserver.js @@ -1,14 +1,11 @@ 'use strict'; -process.on('SIGINT', function() { - process.exit(); -}); - var mjml = require('mjml'), mjml_maj_ver = parseInt(require('mjml/package.json').version.split('.')[0]), net = require('net'), fs = require('fs'), argv = process.argv.slice(2), + server = null, conf = { host: '127.0.0.1', port: '28101', @@ -16,6 +13,24 @@ var mjml = require('mjml'), mjml: {} }; +function terminate(exit_code) { + if (server && server.listening) { + server.close(function () { + process.exit(exit_code); + }); + } else { + process.exit(exit_code); + } +} + +process.on('SIGINT', function() { + terminate(0); +}); + +process.on('SIGTERM', function() { + terminate(0); +}); + for (var i = 0; i < argv.length; i++) { var kv, key, val, arg = argv[i]; @@ -37,7 +52,7 @@ for (var i = 0; i < argv.length; i++) { '--port=28101 --host=127.0.0.1 --touchstop=/tmp/mjmltcpserver.stop ' + '--mjml.disableMinify=false --mjml.level=soft'); } - process.exit(); + terminate(0); } kv = arg.split('=', 2); key = kv[0]; @@ -57,7 +72,7 @@ for (var i = 0; i < argv.length; i++) { } } catch (err) { console.log('Invalid parsing arg "%s": %s', argv[i], err.message); - process.exit(1); + terminate(1); } } @@ -104,7 +119,7 @@ function handleConnection(conn) { conn.on('end', function() {}); } -var server = net.createServer(); +server = net.createServer(); server.on('connection', handleConnection); server.listen(conf.port, conf.host, function () { console.log('RUN SERVER %s:%s', conf.host, conf.port); @@ -119,7 +134,6 @@ if (conf.touchstop) { fs.watchFile(conf.touchstop, function() { console.log('STOP SERVER (cause touchstop)'); - server.close(); - process.exit(); + terminate(0); }); } From b7d5d1c550ce5bbe69900155aa15bcbf322c0f1d Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Fri, 4 Jan 2019 14:31:50 +0200 Subject: [PATCH 3/9] Added MJML 4.3.0 in travis --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index e2b9988..9d17131 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,31 +13,37 @@ env: - DJANGO_VERSION="<1.9" MJML_VERSION=4.0.5 - DJANGO_VERSION="<1.9" MJML_VERSION=4.1.2 - DJANGO_VERSION="<1.9" MJML_VERSION=4.2.1 + - DJANGO_VERSION="<1.9" MJML_VERSION=4.3.0 - DJANGO_VERSION="<1.10" MJML_VERSION=3.3.5 - DJANGO_VERSION="<1.10" MJML_VERSION=4.0.5 - DJANGO_VERSION="<1.10" MJML_VERSION=4.1.2 - DJANGO_VERSION="<1.10" MJML_VERSION=4.2.1 + - DJANGO_VERSION="<1.10" MJML_VERSION=4.3.0 - DJANGO_VERSION="<1.11" MJML_VERSION=3.3.5 - DJANGO_VERSION="<1.11" MJML_VERSION=4.0.5 - DJANGO_VERSION="<1.11" MJML_VERSION=4.1.2 - DJANGO_VERSION="<1.11" MJML_VERSION=4.2.1 + - DJANGO_VERSION="<1.11" MJML_VERSION=4.3.0 - DJANGO_VERSION="<1.12" MJML_VERSION=3.3.5 - DJANGO_VERSION="<1.12" MJML_VERSION=4.0.5 - DJANGO_VERSION="<1.12" MJML_VERSION=4.1.2 - DJANGO_VERSION="<1.12" MJML_VERSION=4.2.1 + - DJANGO_VERSION="<1.12" MJML_VERSION=4.3.0 - DJANGO_VERSION="<2.1" MJML_VERSION=3.3.5 - DJANGO_VERSION="<2.1" MJML_VERSION=4.0.5 - DJANGO_VERSION="<2.1" MJML_VERSION=4.1.2 - DJANGO_VERSION="<2.1" MJML_VERSION=4.2.1 + - DJANGO_VERSION="<2.1" MJML_VERSION=4.3.0 - DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 - DJANGO_VERSION="<2.2" MJML_VERSION=4.0.5 - DJANGO_VERSION="<2.2" MJML_VERSION=4.1.2 - DJANGO_VERSION="<2.2" MJML_VERSION=4.2.1 + - DJANGO_VERSION="<2.2" MJML_VERSION=4.3.0 matrix: exclude: @@ -45,11 +51,13 @@ matrix: - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.0.5 } - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.1.2 } - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.2.1 } + - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.3.0 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.0.5 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.1.2 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.2.1 } + - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.3.0 } before_install: - . $HOME/.nvm/nvm.sh From 27f0e12c187c2538a4d22daacb4f543b54a83d23 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Mon, 7 Jan 2019 17:33:07 +0200 Subject: [PATCH 4/9] Removed MJML 4.0.5, 4.1.2 and 4.2.1 from travis as MJML has problems with dependencies versions --- .travis.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d17131..b38e02d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,53 +10,29 @@ python: env: - DJANGO_VERSION="<1.9" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.9" MJML_VERSION=4.0.5 - - DJANGO_VERSION="<1.9" MJML_VERSION=4.1.2 - - DJANGO_VERSION="<1.9" MJML_VERSION=4.2.1 - DJANGO_VERSION="<1.9" MJML_VERSION=4.3.0 - DJANGO_VERSION="<1.10" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.10" MJML_VERSION=4.0.5 - - DJANGO_VERSION="<1.10" MJML_VERSION=4.1.2 - - DJANGO_VERSION="<1.10" MJML_VERSION=4.2.1 - DJANGO_VERSION="<1.10" MJML_VERSION=4.3.0 - DJANGO_VERSION="<1.11" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.11" MJML_VERSION=4.0.5 - - DJANGO_VERSION="<1.11" MJML_VERSION=4.1.2 - - DJANGO_VERSION="<1.11" MJML_VERSION=4.2.1 - DJANGO_VERSION="<1.11" MJML_VERSION=4.3.0 - DJANGO_VERSION="<1.12" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.12" MJML_VERSION=4.0.5 - - DJANGO_VERSION="<1.12" MJML_VERSION=4.1.2 - - DJANGO_VERSION="<1.12" MJML_VERSION=4.2.1 - DJANGO_VERSION="<1.12" MJML_VERSION=4.3.0 - DJANGO_VERSION="<2.1" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<2.1" MJML_VERSION=4.0.5 - - DJANGO_VERSION="<2.1" MJML_VERSION=4.1.2 - - DJANGO_VERSION="<2.1" MJML_VERSION=4.2.1 - DJANGO_VERSION="<2.1" MJML_VERSION=4.3.0 - DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<2.2" MJML_VERSION=4.0.5 - - DJANGO_VERSION="<2.2" MJML_VERSION=4.1.2 - - DJANGO_VERSION="<2.2" MJML_VERSION=4.2.1 - DJANGO_VERSION="<2.2" MJML_VERSION=4.3.0 matrix: exclude: - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=3.3.5 } - - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.0.5 } - - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.1.2 } - - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.2.1 } - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.3.0 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 } - - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.0.5 } - - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.1.2 } - - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.2.1 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.3.0 } before_install: From c52c85e0b4403b5157864a59794a0f1af0383559 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Mon, 7 Jan 2019 17:43:18 +0200 Subject: [PATCH 5/9] Upgraded MJML to 4.3.0 in dockerfile --- docker/mjml-tcpserver/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/mjml-tcpserver/Dockerfile b/docker/mjml-tcpserver/Dockerfile index 8c44a6a..45432e1 100644 --- a/docker/mjml-tcpserver/Dockerfile +++ b/docker/mjml-tcpserver/Dockerfile @@ -1,6 +1,6 @@ FROM node:8-stretch -ARG MJML_VERSION=4.2.1 +ARG MJML_VERSION=4.3.0 ARG APP_DIR=/app RUN npm install mjml@${MJML_VERSION} From 7fbcb2bc9f84a6d0abe1c3d30e7ec5e702f8d2a7 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Mon, 7 Jan 2019 17:43:33 +0200 Subject: [PATCH 6/9] Updated changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3523d1f..698b61a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +0.7.0 (2019-01-XX) +================== + * Removed MJML 4.0.5, 4.1.2 and 4.2.1 from tests + * Added MJML 4.3.0 in tests + * Updated tcp-server adding cleanly termination + * Upgraded MJML to 4.3.0 in dockerfile + * Updated dockerfile by using `exec` + + 0.6.0 (2018-12-06) ================== * Added `MJML_CHECK_CMD_ON_STARTUP` setting (thanks to Marcel Chastain) @@ -6,6 +15,7 @@ * Removed MJML v.2.3.3 from tests * Updated MJML to 4.2.1 in docker + 0.5.4 (2018-10-19) ================== * Fixed Popen PIPE subprocess deadlock by using TemporaryFile for stdout From 0da7c967ef038de15a4d6cc9f4d6c38fde0345c3 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Thu, 10 Jan 2019 16:12:04 +0200 Subject: [PATCH 7/9] Upgraded to MJML 4.3.1 --- .travis.yml | 16 ++++++++-------- CHANGELOG.md | 4 ++-- docker/mjml-tcpserver/Dockerfile | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index b38e02d..327f01a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,30 +10,30 @@ python: env: - DJANGO_VERSION="<1.9" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.9" MJML_VERSION=4.3.0 + - DJANGO_VERSION="<1.9" MJML_VERSION=4.3.1 - DJANGO_VERSION="<1.10" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.10" MJML_VERSION=4.3.0 + - DJANGO_VERSION="<1.10" MJML_VERSION=4.3.1 - DJANGO_VERSION="<1.11" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.11" MJML_VERSION=4.3.0 + - DJANGO_VERSION="<1.11" MJML_VERSION=4.3.1 - DJANGO_VERSION="<1.12" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<1.12" MJML_VERSION=4.3.0 + - DJANGO_VERSION="<1.12" MJML_VERSION=4.3.1 - DJANGO_VERSION="<2.1" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<2.1" MJML_VERSION=4.3.0 + - DJANGO_VERSION="<2.1" MJML_VERSION=4.3.1 - DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 - - DJANGO_VERSION="<2.2" MJML_VERSION=4.3.0 + - DJANGO_VERSION="<2.2" MJML_VERSION=4.3.1 matrix: exclude: - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=3.3.5 } - - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.3.0 } + - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=4.3.1 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 } - - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.3.0 } + - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.3.1 } before_install: - . $HOME/.nvm/nvm.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 698b61a..fbb56b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ 0.7.0 (2019-01-XX) ================== * Removed MJML 4.0.5, 4.1.2 and 4.2.1 from tests - * Added MJML 4.3.0 in tests + * Added MJML 4.3.1 in tests * Updated tcp-server adding cleanly termination - * Upgraded MJML to 4.3.0 in dockerfile + * Upgraded MJML to 4.3.1 in dockerfile * Updated dockerfile by using `exec` diff --git a/docker/mjml-tcpserver/Dockerfile b/docker/mjml-tcpserver/Dockerfile index 45432e1..499412d 100644 --- a/docker/mjml-tcpserver/Dockerfile +++ b/docker/mjml-tcpserver/Dockerfile @@ -1,6 +1,6 @@ FROM node:8-stretch -ARG MJML_VERSION=4.3.0 +ARG MJML_VERSION=4.3.1 ARG APP_DIR=/app RUN npm install mjml@${MJML_VERSION} From 9cdcfce6969bc5c11663683e8d151a1e042ee646 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Sat, 6 Apr 2019 16:38:24 +0300 Subject: [PATCH 8/9] Added supporting Django v2.2 --- .travis.yml | 6 ++++++ CHANGELOG.md | 3 ++- README.rst | 1 + mjml/__init__.py | 2 +- requirements.txt | 6 ++---- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 327f01a..9932ff4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,9 @@ env: - DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 - DJANGO_VERSION="<2.2" MJML_VERSION=4.3.1 + - DJANGO_VERSION="<2.3" MJML_VERSION=3.3.5 + - DJANGO_VERSION="<2.3" MJML_VERSION=4.3.1 + matrix: exclude: - { python: "2.7", env: DJANGO_VERSION="<2.1" MJML_VERSION=3.3.5 } @@ -35,6 +38,9 @@ matrix: - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=3.3.5 } - { python: "2.7", env: DJANGO_VERSION="<2.2" MJML_VERSION=4.3.1 } + - { python: "2.7", env: DJANGO_VERSION="<2.3" MJML_VERSION=3.3.5 } + - { python: "2.7", env: DJANGO_VERSION="<2.3" MJML_VERSION=4.3.1 } + before_install: - . $HOME/.nvm/nvm.sh - nvm install 8 diff --git a/CHANGELOG.md b/CHANGELOG.md index fbb56b4..9b02a06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ -0.7.0 (2019-01-XX) +0.7.0 (2019-04-06) ================== * Removed MJML 4.0.5, 4.1.2 and 4.2.1 from tests * Added MJML 4.3.1 in tests * Updated tcp-server adding cleanly termination * Upgraded MJML to 4.3.1 in dockerfile * Updated dockerfile by using `exec` + * Added supporting Django v2.2 0.6.0 (2018-12-06) diff --git a/README.rst b/README.rst index 84c08f8..753c5a9 100644 --- a/README.rst +++ b/README.rst @@ -160,3 +160,4 @@ Or you can use docker-compose:: - "28102" ports: - "28102:28102" + diff --git a/mjml/__init__.py b/mjml/__init__.py index bc78757..36498e0 100644 --- a/mjml/__init__.py +++ b/mjml/__init__.py @@ -1,3 +1,3 @@ -__version__ = '0.6.0' +__version__ = '0.7.0' default_app_config = 'mjml.apps.MJMLConfig' diff --git a/requirements.txt b/requirements.txt index 2697aea..1845425 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,8 @@ -pip==18.1 -setuptools==40.6.2 -wheel==0.32.3 +wheel==0.33.1 twine==1.12.1 django<1.12; python_version < "3" -django>=1.8,<2.2; python_version >= "3" +django>=1.8,<2.3; python_version >= "3" coverage==4.5.2 six==1.11.0 ndg-httpsclient==0.5.1; python_version < "3" From a3bd6c525a811b2cf009c4b457e5beaca6f92907 Mon Sep 17 00:00:00 2001 From: Igor Melnyk Date: Sat, 6 Apr 2019 21:13:28 +0300 Subject: [PATCH 9/9] Added supporting Django v2.2 --- requirements.txt | 8 ++++---- setup.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1845425..8bd3f17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ wheel==0.33.1 -twine==1.12.1 +twine==1.13.0 django<1.12; python_version < "3" django>=1.8,<2.3; python_version >= "3" -coverage==4.5.2 -six==1.11.0 -ndg-httpsclient==0.5.1; python_version < "3" +coverage==4.5.3 +six==1.12.0 +ndg-httpsclient>=0.5.1; python_version < "3" diff --git a/setup.py b/setup.py index 6122ff0..70b9d0b 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ zip_safe=False, # because include static platforms=['OS Independent'], install_requires=[ - 'django>=1.8,<2.2', + 'django>=1.8,<2.3', ], keywords=[ 'django', 'mjml', 'django-mjml', 'email', 'layout', 'template', 'templatetag',