mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-03-12 19:50:00 +00:00
run the same project again if we don't reach the latest rev
This commit is contained in:
parent
5428347bfe
commit
827c3d4888
@ -4,8 +4,8 @@ scm:
|
|||||||
repository: ./test/repos/mercurial
|
repository: ./test/repos/mercurial
|
||||||
rev: default
|
rev: default
|
||||||
|
|
||||||
# catchRev:
|
catchRev:
|
||||||
# comment: !!js/regexp //
|
comment: !!js/regexp //
|
||||||
|
|
||||||
notify:
|
notify:
|
||||||
on:
|
on:
|
||||||
@ -45,7 +45,7 @@ steps:
|
|||||||
- cmd: cat 1.txt 2.txt
|
- cmd: cat 1.txt 2.txt
|
||||||
- shell: /bin/bash
|
- shell: /bin/bash
|
||||||
cmd: >
|
cmd: >
|
||||||
for i in {1..30}; do
|
for i in {1..10}; do
|
||||||
echo "tick $i";
|
echo "tick $i";
|
||||||
sleep 0.3;
|
sleep 0.3;
|
||||||
done;
|
done;
|
||||||
|
@ -5,7 +5,8 @@ var Steppy = require('twostep').Steppy,
|
|||||||
Node = require('./node').Node,
|
Node = require('./node').Node,
|
||||||
EventEmitter = require('events').EventEmitter,
|
EventEmitter = require('events').EventEmitter,
|
||||||
inherits = require('util').inherits,
|
inherits = require('util').inherits,
|
||||||
notifier = require('./notifier');
|
notifier = require('./notifier'),
|
||||||
|
utils = require('./utils');
|
||||||
|
|
||||||
|
|
||||||
function Distributor(params) {
|
function Distributor(params) {
|
||||||
@ -97,6 +98,18 @@ Distributor.prototype._runNext = function(callback) {
|
|||||||
|
|
||||||
executor.once('scmData', function(scmData) {
|
executor.once('scmData', function(scmData) {
|
||||||
self._updateBuild(build, {scm: scmData});
|
self._updateBuild(build, {scm: scmData});
|
||||||
|
// run the same project again if we don't reach the latest rev
|
||||||
|
if (!scmData.isLatest) {
|
||||||
|
self.run({
|
||||||
|
projectName: build.project.name,
|
||||||
|
initiator: {
|
||||||
|
type: 'build',
|
||||||
|
id: build.id,
|
||||||
|
number: build.number,
|
||||||
|
project: {name: build.project.name}
|
||||||
|
},
|
||||||
|
}, utils.logErrorCallback);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// update wait reasons for all queue items after run
|
// update wait reasons for all queue items after run
|
||||||
|
@ -74,7 +74,7 @@ Executor.prototype._getTarget = function(rev, changes) {
|
|||||||
|
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
result.rev = changes[index].id;
|
result.rev = changes[index].id;
|
||||||
result.changes = changes.slice(0, index);
|
result.changes = changes.slice(0, index + 1);
|
||||||
result.changes.reverse();
|
result.changes.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,16 +65,11 @@ Executor.prototype._getSources = function(params, callback) {
|
|||||||
this.pass(changes);
|
this.pass(changes);
|
||||||
scm.getRev(params.rev, this.slot());
|
scm.getRev(params.rev, this.slot());
|
||||||
},
|
},
|
||||||
function(err, rev, changes, latestRev) {
|
function(err, currentRev, changes, latestRev) {
|
||||||
// add current rev to the lates changes (if it's not yet there)
|
|
||||||
if (changes.length && changes[0].id !== rev.id) {
|
|
||||||
changes.unshift(rev);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.pass({
|
this.pass({
|
||||||
rev: rev,
|
rev: currentRev,
|
||||||
changes: changes,
|
changes: changes,
|
||||||
isLatest: changes.length && changes[0].id === latestRev.id
|
isLatest: currentRev.id === latestRev.id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
callback
|
callback
|
||||||
|
Loading…
Reference in New Issue
Block a user