mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 17:46:18 +00:00
rename notification strategies according to statuses
This commit is contained in:
parent
d24b5b984b
commit
96a7509280
@ -15,7 +15,7 @@ work in progress...
|
||||
* ~~Project relations (blocks, triggers, etc)~~
|
||||
* Writes to stderr must not break the build
|
||||
* Mail and jabber notifications (with commits, current step and error)
|
||||
* Rename notification strategies according to statuses
|
||||
* ~~Rename notification strategies according to statuses~~
|
||||
* Work with git
|
||||
* Build every commit, commit with tag, etc
|
||||
* Safe id and build numbers generation
|
||||
|
@ -7,7 +7,7 @@ scm:
|
||||
|
||||
notify:
|
||||
on:
|
||||
- fail
|
||||
- error
|
||||
to:
|
||||
console:
|
||||
|
||||
|
@ -6,8 +6,8 @@ scm:
|
||||
|
||||
notify:
|
||||
on:
|
||||
# - success
|
||||
# - fail
|
||||
# - done
|
||||
# - error
|
||||
- change
|
||||
to:
|
||||
console:
|
||||
|
@ -74,9 +74,9 @@ exports.send = function(build, callback) {
|
||||
},
|
||||
function(err, notify, prevBuild) {
|
||||
var strategy = _(notify.on).find(function(strategy) {
|
||||
if (strategy === 'success') {
|
||||
if (strategy === 'done') {
|
||||
return build.status === 'done';
|
||||
} else if (strategy === 'fail') {
|
||||
} else if (strategy === 'error') {
|
||||
return build.status === 'error';
|
||||
} else if (strategy === 'change') {
|
||||
// notify on status change or about first build
|
||||
|
@ -77,11 +77,11 @@ describe('notifier module', function() {
|
||||
}).extend(build);
|
||||
};
|
||||
|
||||
describe('notify on success', function() {
|
||||
describe('notify on done', function() {
|
||||
it('set build info', function() {
|
||||
build = makeBuild({
|
||||
status: 'done',
|
||||
project: {notify: {on: ['success']}}
|
||||
project: {notify: {on: ['done']}}
|
||||
});
|
||||
sendSpy.reset();
|
||||
});
|
||||
@ -96,7 +96,7 @@ describe('notifier module', function() {
|
||||
|
||||
it('should be notified with right params', function() {
|
||||
expect(sendSpy.calledWith({
|
||||
notifyReason: {strategy: 'success'},
|
||||
notifyReason: {strategy: 'done'},
|
||||
build: build
|
||||
})).equal(true);
|
||||
});
|
||||
@ -115,11 +115,11 @@ describe('notifier module', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('notify on fail', function() {
|
||||
describe('notify on error', function() {
|
||||
it('set build info', function() {
|
||||
build = makeBuild({
|
||||
status: 'error',
|
||||
project: {notify: {on: ['fail']}}
|
||||
project: {notify: {on: ['error']}}
|
||||
});
|
||||
sendSpy.reset();
|
||||
});
|
||||
@ -134,7 +134,7 @@ describe('notifier module', function() {
|
||||
|
||||
it('should be notified with right params', function() {
|
||||
expect(sendSpy.calledWith({
|
||||
notifyReason: {strategy: 'fail'},
|
||||
notifyReason: {strategy: 'error'},
|
||||
build: build
|
||||
})).equal(true);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user