From b114a7902e613b1bf982e4ec72ba32213c077a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Moreira?= Date: Fri, 9 Oct 2015 12:12:43 +0100 Subject: [PATCH] add test to endpoint --- CHANGELOG.md | 4 ++++ LAUNCHER.README.md | 2 +- ONBUILD.README.md | 3 ++- entrypoint | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85eb9de4..117f8a4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 9-Out-2015 + +* Added `test` command which proxies to `npm test` on `/app` folder + ## 8-Out-2015 * Added packages needed for some native modules diff --git a/LAUNCHER.README.md b/LAUNCHER.README.md index 02670e2d..939d0df3 100644 --- a/LAUNCHER.README.md +++ b/LAUNCHER.README.md @@ -19,7 +19,7 @@ bash-3.2$ node.docker 0.12.7 > 0.12.7 is up and running from dockercache (^C again to quit) > -bash-3.2$ dnode 4.1.1 +bash-3.2$ node.docker 4.1.1 Unable to find image 'cusspvz/node:4.1.1' locally 4.1.1: Pulling from cusspvz/node 9caf287e1f2d: Pull complete diff --git a/ONBUILD.README.md b/ONBUILD.README.md index 9198c35c..a8d288f2 100644 --- a/ONBUILD.README.md +++ b/ONBUILD.README.md @@ -46,7 +46,8 @@ Under the hood, it executes the following commands: * `CMD [ "start" ]` - I've put here an `entrypoint` that has the following behaviors: * ` ` - If nothing is supplied, it will just exec `node` - * `start` (Default) - proxies `npm start` so your app could run + * `start` (Default) - proxies `npm start` so your app could start + * `test` - proxies `npm test` so your app could run tests * `shell` - proxies to `/bin/sh` ## What if i need to install stuff on my container? diff --git a/entrypoint b/entrypoint index e45bed31..b2b1d9af 100644 --- a/entrypoint +++ b/entrypoint @@ -13,6 +13,12 @@ if [ "$1" == "start" ]; then exit $? fi +if [ "$1" == "test" ]; then + cd /app + exec $NODE_PREFIX/bin/npm test + exit $? +fi + if [ "$1" == "shell" ] || \ [ "$1" == "sh" ] || \ [ "$1" == "bash" ] || \