基于Git的网站部署工作流程 [英] Git-based website deployment workflow

查看:90
本文介绍了基于Git的网站部署工作流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的服务器上,我有两个用户,www-data(由nginx使用)和git. git用户拥有一个包含我的网站代码的存储库,而www-data用户拥有该存储库的副本(用作nginx的webroot).我想设置一个工作流,以便推送到git的存储库会导致www-data的存储库更新,从而更新我的网站.

On my server, I have two users, www-data (which is used by nginx) and git. The git user owns a repository that contains my website's code, and the www-data user owns a clone of that repository (which serves as the webroot for nginx). I want to set up a workflow such that pushing to git's repository causes www-data's repository to update, thus updating my website.

为这些存储库设置钩子的正确方法是什么(还要考虑这两个用户的特权和权限)?

What is the correct way to set up the hooks for these repositories (that also takes into consideration privileges and permissions of these two users)?

推荐答案

删除www-data拥有的存储库,并在此网页,用于在git拥有的存储库中设置接收后挂钩.

Remove the repository owned by www-data and follow the solution on this webpage for setting up a post-receive hook in the repository owned by git.

这篇关于基于Git的网站部署工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆