mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-10 21:45:08 +00:00
57 lines
1.1 KiB
JavaScript
57 lines
1.1 KiB
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: {
|
|
name: {type: 'string'},
|
|
type: {type: 'string'},
|
|
usageStrategy: {type: 'string'},
|
|
maxExecutorsCount: {type: 'integer'},
|
|
options: {type: 'object'}
|
|
}
|
|
},
|
|
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);
|
|
}
|
|
);
|
|
};
|