Skip to content

Instantly share code, notes, and snippets.

@alesanabriav
Created May 21, 2015 23:05
Show Gist options
  • Save alesanabriav/2c2443a509ae100b11ac to your computer and use it in GitHub Desktop.
Save alesanabriav/2c2443a509ae100b11ac to your computer and use it in GitHub Desktop.
deploy
app.post('/deploy/', function (req, res) {
var spawn = require('child_process').spawn,
deploy = spawn('sh', [ './deploy.sh' ]);
deploy.stdout.on('data', function (data) {
console.log(''+data);
});
deploy.on('close', function (code) {
console.log('Child process exited with code ' + code);
});
res.json(200, {message: 'Github Hook received!'})
});
git reset --hard origin/master
git clean -f
git pull
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment