gulp-slack-upload
v0.4.4
Published
Upload files to Slack using Gulp
Downloads
17
Maintainers
Readme
gulp-slack-upload
Gulp plugin to upload files to Slack.
Installation
npm install --save-dev gulp-slack-upload
Usage
You will need an API key from Slack Web API.
var gulp = require('gulp');
var fs = require('fs');
var path = require('path');
var slackUpload = require('gulp-slack-upload');
var slackApiKey = 'xoxo-0123456789-etc';
var slackUploadOptions = {
file: fs.createReadStream(path.join(__dirname, 'gulp-build.log')),
filetype: 'post',
title: 'Gulp Build Results',
initialComment: 'Results for the latest Gulp build',
channels: '#gulp-builds'
}
gulp.task('upload:slack', function() {
return gulp.src('./src')
.pipe(someBuildTasks()) // Do some build tasks
.pipe(slackUpload(slackApiKey, slackUploadOptions));
});