https://github.com/jasonmit/grunt-hipchat-v2-notifier
This is a fork of grunt-hipchat-notifier to support the Hipchat V2 API
https://github.com/jasonmit/grunt-hipchat-v2-notifier
Last synced: 3 months ago
JSON representation
This is a fork of grunt-hipchat-notifier to support the Hipchat V2 API
- Host: GitHub
- URL: https://github.com/jasonmit/grunt-hipchat-v2-notifier
- Owner: jasonmit
- License: mit
- Archived: true
- Created: 2014-07-21T21:17:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-05T20:04:11.000Z (over 10 years ago)
- Last Synced: 2024-10-03T11:42:14.190Z (8 months ago)
- Language: CoffeeScript
- Size: 188 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# Grunt: Hipchat Notifier
> Send grunt messages to a Hipchat channel## Getting Started
This plugin requires Grunt `~0.4.1`If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
Add the following to package.json
```js
"grunt-hipchat-v2-notifier": "git+ssh://[email protected]/jasonmit/grunt-hipchat-v2-notifier.git"
``````js
grunt.loadNpmTasks('grunt-hipchat-v2-notifier');
```## The "hipchat_notifier" task
### Overview
In your project's Gruntfile, add a section named `hipchat_notifier` to the data object passed into `grunt.initConfig()`.```js
grunt.initConfig({
hipchat_notifier: {// You probably want to set your Hipchat options globally...
options: {
token: "", // Create an token for the room @ https://hipchat.com/
roomId: "" // Numeric Hipchat roomId or room name
},// Now create as many messages as you like!
hello_grunt: {
options: {
message: "Hello!", // A message to send
color: "purple", // Color of the message
message_format: "html" // Can either be 'text' or 'html' format
}
},// Send dynamic message based off anything Node/Grunt/Javascript can do!
dynamic_hello_grunt: {
options: {
message: function() { // Functions must return a string
var pkg = grunt.config.data.pkg;
return 'Running grunt on ' + pkg.name + ' on version ' + pkg.name;
},
from: function() { // Return the run-time user, or something more creative.
return someUsernameGenerator() || process.env['USER'];
},
// Change color dynamically based on some global state, function response, etc
color: function() {
return (grunt.config.data.someBoolean && allIsWell()) ? 'green' : 'red';
}
}
}},
})
```