diff --git a/.travis.yml b/.travis.yml index dd6695dad0..c2fc1eeece 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,4 @@ before_install: language: node_js node_js: - "0.11" - - "0.10" - - "0.8" \ No newline at end of file + - "0.10" \ No newline at end of file diff --git a/README.md b/README.md index bbc0b4b6dd..1e6a1fbed3 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Credit: [Convoe](http://www.convoe.com), [Kano](http://www.kano.me), [Manchester NodeBB requires the following software to be installed: -* A version of Node.js at least 0.8 or greater +* A version of Node.js at least 0.10 or greater * Redis, version 2.6 or greater **or** MongoDB, version 2.4 or greater * nginx, version 1.3.13 or greater (**only if** intending to use nginx to proxy requests to a NodeBB) diff --git a/src/install.js b/src/install.js index e530aa274f..680eefeccb 100644 --- a/src/install.js +++ b/src/install.js @@ -79,7 +79,7 @@ var async = require('async'), setup: function (callback) { async.series([ - function(next) { + function (next) { // Check if the `--setup` flag contained values we can work with var setupVal; try { @@ -104,6 +104,30 @@ var async = require('async'), next(); } }, + function (next) { + // Check if the `--ci` flag contained values we can work with + var ciVals; + try { + ciVals = JSON.parse(nconf.get('ci')); + } catch (e) { + ciVals = undefined; + } + + if (ciVals && ciVals instanceof Object) { + if (ciVals.hasOwnProperty('host') && ciVals.hasOwnProperty('port') && ciVals.hasOwnProperty('database')) { + install.ciVals = ciVals; + next(); + } else { + winston.error('Required values are missing for automated CI integration:'); + if (!ciVals.hasOwnProperty('host')) winston.error(' host'); + if (!ciVals.hasOwnProperty('port')) winston.error(' port'); + if (!ciVals.hasOwnProperty('database')) winston.error(' database'); + process.exit(); + } + } else { + next(); + } + }, function (next) { var success = function (err, config) { if (!config) { @@ -165,6 +189,16 @@ var async = require('async'), }); }; + // Add CI object + if (install.ciVals) { + config['test_database'] = {}; + for(var prop in install.ciVals) { + if (install.ciVals.hasOwnProperty(prop)) { + config['test_database'][prop] = install.ciVals[prop]; + } + } + } + if(config.database === 'redis') { if (config['redis:host'] && config['redis:port']) { dbQuestionsSuccess(null, config);