mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-11 03:29:17 +00:00
add option to skip running of already queued build
This commit is contained in:
parent
89d6484dd7
commit
486d2006c0
@ -63,6 +63,7 @@ module.exports = function(app) {
|
|||||||
app.distributor.run({
|
app.distributor.run({
|
||||||
projectName: projectName,
|
projectName: projectName,
|
||||||
withScmChangesOnly: req.body.withScmChangesOnly,
|
withScmChangesOnly: req.body.withScmChangesOnly,
|
||||||
|
skipQueued: req.body.skipQueued,
|
||||||
initiator: {type: 'httpApi'}
|
initiator: {type: 'httpApi'}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -273,6 +273,19 @@ Distributor.prototype.run = function(params, callback) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.skipQueued) {
|
||||||
|
var queuedItem = _(self.queue).find(function(item) {
|
||||||
|
return item.project.name === project.name;
|
||||||
|
});
|
||||||
|
if (queuedItem) {
|
||||||
|
logger.log(
|
||||||
|
'Building of "%s" skipped coz it`s already queued',
|
||||||
|
project.name
|
||||||
|
);
|
||||||
|
return callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self._updateBuild({}, {
|
self._updateBuild({}, {
|
||||||
project: project,
|
project: project,
|
||||||
initiator: params.initiator,
|
initiator: params.initiator,
|
||||||
|
Loading…
Reference in New Issue
Block a user