ensure CouchDB 2.0 Docker is stopped after each test run
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/939c980a Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/939c980a Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/939c980a Branch: refs/heads/master Commit: 939c980acb335a04142018d713251b9ea3186780 Parents: cb870b8 Author: Glynn Bird <[email protected]> Authored: Thu Oct 27 08:47:06 2016 +0100 Committer: Glynn Bird <[email protected]> Committed: Thu Oct 27 08:47:06 2016 +0100 ---------------------------------------------------------------------- package.json | 2 +- scripts/run_couchdb_on_travis.sh | 1 + scripts/stop_couchdb_on_travis.sh | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/939c980a/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 78d8eb9..9f8fdfe 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "tape-it": "^0.3.1" }, "scripts": { - "test": "bash scripts/run_couchdb_on_travis.sh; npm run mocha", + "test": "bash scripts/run_couchdb_on_travis.sh; npm run mocha; bash scripts/stop_couchdb_on_travis.sh", "mocha": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js", "unmocked": "NOCK_OFF=true tape tests/*/*/*.js", "mocked": "tape tests/*/*/*.js", http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/939c980a/scripts/run_couchdb_on_travis.sh ---------------------------------------------------------------------- diff --git a/scripts/run_couchdb_on_travis.sh b/scripts/run_couchdb_on_travis.sh index fa7a30c..193a60e 100755 --- a/scripts/run_couchdb_on_travis.sh +++ b/scripts/run_couchdb_on_travis.sh @@ -2,6 +2,7 @@ if [ ! -z $TRAVIS ]; then # Install CouchDB Master + echo "Starting CouchDB 2.0 Docker" docker run --ulimit nofile=2048:2048 -d -p 5984:5984 klaemo/couchdb:2.0-dev@sha256:336fd3d9a89475205fc79b6a287ee550d258fac3b62c67b8d13b8e66c71d228f --with-haproxy \ --with-admin-party-please -n 1 http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/939c980a/scripts/stop_couchdb_on_travis.sh ---------------------------------------------------------------------- diff --git a/scripts/stop_couchdb_on_travis.sh b/scripts/stop_couchdb_on_travis.sh new file mode 100755 index 0000000..4f80bce --- /dev/null +++ b/scripts/stop_couchdb_on_travis.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [ ! -z $TRAVIS ]; then + echo "Stopping CouchDB 2.0 Docker" + docker stop $(docker ps -a -q) + docker rm $(docker ps -a -q) +fi \ No newline at end of file
