Created
May 21, 2015 23:05
-
-
Save alejandrosanabriav/2c2443a509ae100b11ac to your computer and use it in GitHub Desktop.
deploy
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
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!'}) | |
}); |
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
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