mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-10 17:49:17 +00:00
change distributor run signature
This commit is contained in:
parent
a832398859
commit
a704129a16
@ -107,7 +107,9 @@ Distributor.prototype._onBuildComplete = function(err, build, callback) {
|
||||
if (after) {
|
||||
_(after).each(function(item) {
|
||||
if (!item.status || item.status === build.status) {
|
||||
self.run(item.project, {}, triggerAfterGroup.slot());
|
||||
self.run({
|
||||
projectName: item.project
|
||||
}, triggerAfterGroup.slot());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -158,15 +160,15 @@ Distributor.prototype._updateBuild = function(build, changes, callback) {
|
||||
);
|
||||
};
|
||||
|
||||
Distributor.prototype.run = function(projectName, params, callback) {
|
||||
Distributor.prototype.run = function(params, callback) {
|
||||
var self = this,
|
||||
project;
|
||||
Steppy(
|
||||
function() {
|
||||
project = self.projectsHash[projectName].config;
|
||||
project = self.projectsHash[params.projectName].config;
|
||||
self._updateBuild({}, {
|
||||
project: project,
|
||||
params: params,
|
||||
params: params.params,
|
||||
createDate: Date.now(),
|
||||
status: 'queued',
|
||||
completed: false
|
||||
|
@ -109,8 +109,8 @@ module.exports = function(app) {
|
||||
|
||||
resource.use('run', function(req, res) {
|
||||
var projectName = req.data.projectName;
|
||||
console.log('Run the project: %j', projectName);
|
||||
distributor.run(projectName, {}, function(err, build) {
|
||||
console.log('Run the project: %s', projectName);
|
||||
distributor.run({projectName: projectName}, function(err, build) {
|
||||
console.log('>>> err, build = ', err && err.stack || err, build);
|
||||
});
|
||||
res.send();
|
||||
|
@ -55,7 +55,7 @@ describe('Distributor', function() {
|
||||
});
|
||||
|
||||
it('should run without errors', function(done) {
|
||||
distributor.run('project1', {}, function(err) {
|
||||
distributor.run({projectName: 'project1'}, function(err) {
|
||||
expect(err).not.ok();
|
||||
done();
|
||||
});
|
||||
@ -118,7 +118,7 @@ describe('Distributor', function() {
|
||||
});
|
||||
|
||||
it('should run without errors', function(done) {
|
||||
distributor.run('project1', {}, function(err) {
|
||||
distributor.run({projectName: 'project1'}, function(err) {
|
||||
expect(err).not.ok();
|
||||
done();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user