Last active
August 29, 2015 14:19
-
-
Save hansott/0cde1a26e5851e6107b2 to your computer and use it in GitHub Desktop.
Gitlab Web Hook using Node.js
This file contains 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
1. `$ npm install gitlabhook` | |
2. Copy webhook.js in directory | |
3. Create systemd service, instructions can be found here: https://github.com/rolfn/node-gitlab-hook#installation-hints-for-linux | |
4. Or test using `node webhook.js` |
This file contains 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
var gitlabhook = require('gitlabhook'); | |
var util = require('util'); | |
var exec = require('child_process').exec; | |
var child; | |
var gitlab = gitlabhook({}, function() { | |
child = exec('cd .. && cd wmd1415_project2 && git pull', function(err, stdout, stderr) { | |
console.log(stdout); | |
console.log(stderr); | |
if (err !== null) { | |
console.log(err); | |
} | |
}); | |
}); | |
gitlab.listen(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment