开发者

Git post-update hook as a deploy management. Just like heroku

I want to git push to server repo, and then post-update hook will pull lastest repo to deploy folder, and restart the daemon.

but git user can not access deploy folder and can't restart the daemon.

How can I 开发者_开发技巧do git push deployment as heroku.


You could use a similar mechanism than the push on Heroku: a ssh-based operation.

Your git user on the server side (i.e. the git user running the post-update hook) would called a deployment script through rsh, which means that git user account has:

  • a public key published on the $HOME/.ssh/authorized_keys of the server user (i.e. the user able to access the deploy folder and who owns the daemon process)
  • a private key (in his $HOME/.ssh)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜