mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 01:55:07 +00:00
54 lines
996 B
JavaScript
54 lines
996 B
JavaScript
'use strict';
|
|
|
|
var Steppy = require('twostep').Steppy,
|
|
validateParams = require('./validateParams');
|
|
|
|
module.exports = function(config, callback) {
|
|
Steppy(
|
|
function() {
|
|
validateParams(config, {
|
|
type: 'object',
|
|
properties: {
|
|
plugins: {
|
|
type: 'array',
|
|
items: {type: 'string'}
|
|
},
|
|
nodes: {
|
|
type: 'array',
|
|
required: true,
|
|
items: {
|
|
type: 'object',
|
|
properties: {
|
|
type: {type: 'string', enum: ['local']},
|
|
maxExecutorsCount: {type: 'integer'}
|
|
}
|
|
},
|
|
minItems: 1
|
|
},
|
|
storage: {
|
|
type: 'object',
|
|
required: true,
|
|
properties: {
|
|
backend: {type: 'string', required: true}
|
|
}
|
|
},
|
|
notify: {
|
|
type: 'object'
|
|
}
|
|
},
|
|
additionalProperties: true
|
|
});
|
|
|
|
this.pass(null);
|
|
},
|
|
function(err) {
|
|
if (err) {
|
|
err.message = (
|
|
'Error during validation server config: "' + err.message
|
|
);
|
|
}
|
|
callback(err, config);
|
|
}
|
|
);
|
|
};
|