1 | const { gulp, yargs: y } = require('../singleton');
|
2 |
|
3 | gulp.task('notify:deploy', () => {
|
4 | const deploy = require('../lib/notify/deployment');
|
5 | const isError = y.argv.error !== false;
|
6 | return deploy.notifyDeployment(y.argv.destination, isError);
|
7 | });
|
8 |
|
9 | gulp.task('notify:rollbar', () => {
|
10 | const rollbar = require('../lib/notify/rollbar');
|
11 | return new Promise((resolve, reject) => {
|
12 | const isError = y.argv.error !== false;
|
13 | if (rollbar.enabled) {
|
14 | rollbar.sendMessage(y.argv.message, isError, {
|
15 | key1: 'value1',
|
16 | key2: 'value2',
|
17 | }).then((response) => {
|
18 | resolve(response);
|
19 | }).catch((reason) => {
|
20 | reject(reason);
|
21 | });
|
22 | } else {
|
23 | reject(rollbar.ERR_ROLLBAR_NOT_ENABLED);
|
24 | }
|
25 | });
|
26 | });
|