mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-10 18:09:15 +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({
|
||||
projectName: projectName,
|
||||
withScmChangesOnly: req.body.withScmChangesOnly,
|
||||
skipQueued: req.body.skipQueued,
|
||||
initiator: {type: 'httpApi'}
|
||||
});
|
||||
} else {
|
||||
|
@ -273,6 +273,19 @@ Distributor.prototype.run = function(params, 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({}, {
|
||||
project: project,
|
||||
initiator: params.initiator,
|
||||
|
Loading…
Reference in New Issue
Block a user