From 3fb86a280331d23984b2ca7e2626593a7a7a15b9 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Tue, 1 Dec 2015 11:56:53 +0100 Subject: [PATCH 1/3] upgrade node to 4.2.2. Closes #106 --- Dockerfile | 2 +- README.md | 9 +++++++++ docker-compose.yml | 2 +- lib/logger.js | 4 +++- package.json | 6 +++--- .../js/__tests__/components/feature/FeatureForm-test.js | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4031ac120b..68cf1faf70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nodesource/trusty:0.12 +FROM node:4.2.2 COPY . . diff --git a/README.md b/README.md index d9030d034d..66d60576ec 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,15 @@ Known client implementations: - [unleash-client-java](https://github.com/finn-no/unleash-client-java) - [unleash-client-node](https://github.com/finn-no/unleash-client-node) +## Run with docker +We have set up docker-compose to start postgres and the unleash server together. This makes it really fast to start up +unleash locally without setting up a database or node. + +```bash +$ docker-compose build +$ docker-compose up +``` + ## Development ### Create a local unleash databases in postgres diff --git a/docker-compose.yml b/docker-compose.yml index 27cc6f5063..685f755d85 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ web: build: . - command: run db-migrate-and-start + command: npm run db-migrate-and-start ports: - "4242:4242" links: diff --git a/lib/logger.js b/lib/logger.js index 713ad2c3a5..bbdc7f7531 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -8,8 +8,10 @@ var logger = log4js.getLogger('unleash'); // TODO: make level configurable if (process.env.NODE_ENV === 'production') { logger.setLevel(log4js.levels.ERROR); +} else if (process.env.NODE_ENV === 'test') { + logger.setLevel(log4js.levels.ERROR); } else { logger.setLevel(log4js.levels.DEBUG); } -module.exports = logger; \ No newline at end of file +module.exports = logger; diff --git a/package.json b/package.json index 1bb6f21362..eccef21aa8 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "bluebird": "2.9.14", "body-parser": "1.12.2", "cookie-parser": "^1.3.3", - "db-migrate": "0.9.11", + "db-migrate": "0.9.23", "deep-diff": "^0.3.0", "errorhandler": "1.3.5", "express": "4.12.3", @@ -49,7 +49,7 @@ "ini": "1.3.3", "jsx-loader": "0.12.2", "jsxhint": "0.13.2", - "knex": "^0.7.3", + "knex": "^0.9.0", "lodash": "^3.5.0", "log4js": "0.6.22", "moment": "^2.9.0", @@ -66,7 +66,7 @@ "chai": "2.1.2", "coveralls": "^2.11.2", "istanbul": "^0.3.5", - "jest-cli": "0.4.15", + "jest-cli": "0.5.4", "jshint": "^2.6.0", "mocha": "^2.1.0", "mocha-lcov-reporter": "0.0.2", diff --git a/public/js/__tests__/components/feature/FeatureForm-test.js b/public/js/__tests__/components/feature/FeatureForm-test.js index 72c0a9b9f2..581d062fbd 100644 --- a/public/js/__tests__/components/feature/FeatureForm-test.js +++ b/public/js/__tests__/components/feature/FeatureForm-test.js @@ -17,7 +17,7 @@ describe("FeatureForm", function () { it("should render empty form", function() { Component = TestUtils .renderIntoDocument(); var name = Component.getDOMNode().querySelectorAll("input"); - expect(name[0].value).toEqual(undefined); + expect(name[0].value).toEqual(""); }); }); From aed00c22783cd23417ea1e2cb4ec97b4b747e9fb Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Tue, 1 Dec 2015 13:14:16 +0100 Subject: [PATCH 2/3] travis should also use latest node --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e9709de21..bd8ae27364 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: node_js node_js: -- "0.10" +- "5.1" env: TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test before_script: - echo '--timeout 10000' > test/mocha.opts From 5826a25bb9844c4fff2cbb2983f7253d1bb882a6 Mon Sep 17 00:00:00 2001 From: Ivar Date: Wed, 16 Mar 2016 20:44:49 +0100 Subject: [PATCH 3/3] Upgrade to node 5.8 --- .travis.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd8ae27364..20d97819a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: node_js node_js: -- "5.1" +- "5.8" env: TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test before_script: - echo '--timeout 10000' > test/mocha.opts diff --git a/Dockerfile b/Dockerfile index 68cf1faf70..f916eb2c26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:4.2.2 +FROM node:5.8 COPY . .