mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user