Skip to content

Commit

Permalink
Merge pull request #83 from liminspace/develop
Browse files Browse the repository at this point in the history
Release 0.7.0
  • Loading branch information
liminspace authored Apr 6, 2019
2 parents 797502c + a3bd6c5 commit 6f3e595
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 45 deletions.
38 changes: 14 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,36 @@ 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.1

- 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.1

- 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.1

- 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.1

- 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.1

- 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.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 }
- { 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.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.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.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
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
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)
==================
* Added `MJML_CHECK_CMD_ON_STARTUP` setting (thanks to Marcel Chastain)
Expand All @@ -6,6 +16,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
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ Or you can use docker-compose::
- "28102"
ports:
- "28102:28102"

4 changes: 2 additions & 2 deletions docker/mjml-tcpserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:8-stretch

ARG MJML_VERSION=4.2.1
ARG MJML_VERSION=4.3.1
ARG APP_DIR=/app

RUN npm install mjml@${MJML_VERSION}
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion mjml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.6.0'
__version__ = '0.7.0'

default_app_config = 'mjml.apps.MJMLConfig'
32 changes: 23 additions & 9 deletions mjml/node/tcpserver.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
'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',
touchstop: null,
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];
Expand All @@ -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];
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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);
Expand All @@ -119,7 +134,6 @@ if (conf.touchstop) {

fs.watchFile(conf.touchstop, function() {
console.log('STOP SERVER (cause touchstop)');
server.close();
process.exit();
terminate(0);
});
}
14 changes: 6 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
pip==18.1
setuptools==40.6.2
wheel==0.32.3
twine==1.12.1
wheel==0.33.1
twine==1.13.0

django<1.12; python_version < "3"
django>=1.8,<2.2; python_version >= "3"
coverage==4.5.2
six==1.11.0
ndg-httpsclient==0.5.1; python_version < "3"
django>=1.8,<2.3; python_version >= "3"
coverage==4.5.3
six==1.12.0
ndg-httpsclient>=0.5.1; python_version < "3"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 6f3e595

Please sign in to comment.