Last active
August 29, 2015 14:17
-
-
Save MartijnR/38621b556356111e87a2 to your computer and use it in GitHub Desktop.
Webhook in Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var gith = require( 'gith' ).create( 9001 ), | |
execFile = require('child_process').execFile; | |
gith( { | |
repo: 'enketo/enketo-core' | |
} ).on( 'all', function( payload ) { | |
console.log( 'Post-receive happened' ); | |
if ( payload.branch === 'master' ) { | |
// Exec a shell script | |
execFile( './update.sh', function( error, stdout, stderr ) { | |
// Log success in some manner | |
console.log( 'enketo-core was updated and rebuilt!' ); | |
} ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment