Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/distributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Distributor.prototype._runNext = function(callback) {

executor.once('scmData', function(scmData) {
self._updateBuild(build, {scm: scmData});
self.notifier.send(build);
// run the same project again if we don't reach the latest rev
if (!scmData.isLatest) {
self.run({
Expand Down
8 changes: 3 additions & 5 deletions lib/notifier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ Notifier.prototype.send = function(build, callback) {

Steppy(
function() {
if (!build.completed) {
throw new Error('Build should be completed before notify');
}

var notify = build.project.notify;

// TODO: move to project validation during load
Expand All @@ -111,7 +107,9 @@ Notifier.prototype.send = function(build, callback) {
},
function(err, notify, prevBuild) {
var strategy = _(notify.on).find(function(strategy) {
if (strategy === 'done') {
if (strategy === 'started') {
return build.status === 'in-progress';
} else if (strategy === 'done') {
return build.status === 'done';
} else if (strategy === 'error') {
return build.status === 'error';
Expand Down