Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

Slack addon

Tushar Singh edited this page Nov 26, 2016 · 1 revision

The Slack addon is completely decoupled from the core library.

Create interface

const Slack = require('deployrjs/addons/slack')('YOUR_SLACK_HOOK_URL');

You can set the channel and username as well

const Slack = require('deployrjs/addons/slack')('YOUR_SLACK_HOOK_URL', {
    username: 'Beta deployment',
    channel: '#project',
});

Use the interface

deployment.listen((action, pull) => {
    Slack.post('Starting deployment...');

    pull().then(() => exec('npm run build')).then(() => {
        Slack.post('Deployed! :D')
    })
});

Clone this wiki locally