Skip to content

Instantly share code, notes, and snippets.

@y16ra
Created December 16, 2014 07:55
Show Gist options
  • Save y16ra/78430f2d4ad640d0e6fc to your computer and use it in GitHub Desktop.
Save y16ra/78430f2d4ad640d0e6fc to your computer and use it in GitHub Desktop.
WebHook -> git pull
// for GitHub webhook
router.all('/webhook', function(req, res) {
var cmd = exec("git pull", {
cwd: conf.deploy.dir
}, function(error, stdout, stderr) {
if (error) {
debug("> ERROR (error): " + error);
}
if (stderr && error) {
debug("> ERROR (error): " + error);
}
debug("> DONE! " + stdout);
});
res.send("success");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment