changing minimum required version for NodeBB to 0.10, and updated travis config. Allowing new setup option "ci", for TravisCI integration

This commit is contained in:
Julian Lam
2014-04-08 21:08:51 -04:00
parent e579db8bf3
commit 2627240d80
3 changed files with 37 additions and 4 deletions

View File

@@ -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);