Watch github push hooker
This plugin requires Grunt ~0.4.4
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-watch-github --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-watch-github');
You should go to GitHub site and set hook service first. You can find setting on following url:
http://github.com/{your account}/{your project}/settings/hooks/
Create a new webhook and use json version payload. Remember the url port if your hooker listening port is not on 80.
In your project's Gruntfile, add a section named watch_github
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
watch_github: {
repository: {
options: {
bind_address: 'your_server_ip',
bind_port: 'your_server_hooker_listen_port'
}
},
},
});
Type: String
A string value that is your server external ip.
Type: Number
Default value: 9090
A number value that is hook server port.
If use the yeoman generator, you can just work with build task loop like this:
grunt.registerTask('continuousBuild', [
'build',
'watch_gitub',
'continuousBuild'
]);
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
v0.1.0 first version for simple hooker.