如何使用提交后挂钩将提交的文件从 SVN 复制到 Web 目录? [英] How can I use post-commit hooks to copy committed files to a web directory from SVN?

查看:23
本文介绍了如何使用提交后挂钩将提交的文件从 SVN 复制到 Web 目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Ubuntu 服务器安装了 Apache 和 Subversion.我将此服务器用作临时服务器,纯粹是出于测试目的.我使用 Apache 托管 Web 应用程序,使用 Subversion 保留源代码的版本副本.

My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subversion to keep versioned copies of the source code.

我目前的工作流程:

  • 对文件进行更改
  • 将文件提交到 Subversion 存储库
  • 通过 SFTP 将新文件上传到 Apache 公共目录
  • 在我的网络浏览器中查看更改

如果我的工作流程是这样的,我会更开心:

I would be much happier if my workflow was like this:

  • 对文件进行更改
  • 将文件提交到 Subversion 存储库
  • 在后台,Subversion 将提交文件的副本放入 Apache 公共目录
  • 在我的网络浏览器中查看更改

我的服务器管理员经验很少,任何帮助或指示都表示赞赏.我听说 post-commit 钩子是我需要的,我可以编写 bash 脚本来做到这一点,但我不知道从哪里开始,而且在谷歌搜索了很多之后并没有真正找到任何东西.

I have very little server admin experience, and any help or pointers are appreciated. I heard that post-commit hooks are what I need, and that I can write bash scripts to do this, but I'm not sure where to start and didn't really find anything after quite a lot of Googling.

谢谢!

推荐答案

官方"答案在这里.

我正在我的存储库中管理一个网站.如何让实时站点在每次提交后自动更新?

这篇关于如何使用提交后挂钩将提交的文件从 SVN 复制到 Web 目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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