颠覆在线项目

发布于 2024-09-26 15:01:59 字数 238 浏览 8 评论 0原文

我已经开始使用 subversion 来跟踪并能够逆转我们的网站与其开发和维护相关的更改。喜欢它提供的这种安全感!

我想知道是否有一个工具/方法能够自动同步“实时”网站和颠覆存储库。如果能够将错误补丁提交到存储库和实时版本,那就太好了(现在我通过 ftp 手动上传更正的文件,然后将其提交到 subversion 存储库)。

我确信它一定存在于某个地方,但是以什么名字存在?需要什么设置吗?

感谢您的反馈, 一个。

I've started using subversion to keep track - and be able to reverse - of our website changes related to its development and maintenance. Loving this feeling of security it provides!

I would like to know if there would be a tool / a way to be able to automate the synchronisation between the "live" website and the subversion repository. It would be great to be able to both commit a bug patch to the repository and to the live version (right now i manually upload via ftp the corrected file, then commit it to the subversion repository).

I'm sure this must exist somewhere, but under which name ? What set up does it need?

Thank you for your feedback,
A.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柒七 2024-10-03 15:02:00

您可以创建一个提交后挂钩来导出您的存储库位于您的网络服务器目录的最新版本中:(

#!/bin/sh

# Delete Old site
rm -R /var/www/website

# Export Repository
svn export --force file:///var/svn/website /var/www/website

# Make sure Apache Owns the website
chown -R www-data:www-data /var/www/website 

归功于 此论坛帖子)

将其保存在存储库的 hooks 目录中名为 post-commit 的文件中,并使其可执行。

如果存储库和网站不在同一台服务器上,您需要将其导出到临时目录中,然后通过 ftp 或 scp 推送它

编辑:还发现了可以完成这项工作的 perl 模块: SVN::Notify::Mirror

You can create a post-commit hook that will export your repository at the latest revision to your webserver directory:

#!/bin/sh

# Delete Old site
rm -R /var/www/website

# Export Repository
svn export --force file:///var/svn/website /var/www/website

# Make sure Apache Owns the website
chown -R www-data:www-data /var/www/website 

(credits to this forum thread)

Save this in a file called post-commit, in the hooks directory of your repository, and make it executable.

If the repository and website are not on the same server, you'll want to export in a temporary directory, and then push it via ftp or scp

EDIT: found also this perl module that could do the job: SVN::Notify::Mirror

-黛色若梦 2024-10-03 15:02:00

基本上你可以使用svn存储库挂钩来做到这一点,特别是提交后 钩子。

Basicly you could do it with svn repository hooks, especially the post-commit hook.

末骤雨初歇 2024-10-03 15:02:00
  1. 通过执行 svn 在您的网络服务器中创建存储库/网站的工作副本(本地副本)
    查看。
  2. 您可以在 cron/scheduler 中设置任务(取决于 linux/windows)。该任务可以做一个
    svn update 在你的工作副本中。这可以每隔几分钟/小时完成一次,具体取决于您提交的频率。
  3. 指示您的网络服务器不要显示 .svn 目录。如果是 apache,您可以将以下行包含到您的 httpd.conf 中(IIS 中也应该有一种方法,如果 Windows 需要此方法,请告诉我)
;
   订单允许、拒绝
   所有人都否认


AliasMatch \.svn /non-existant-page
  1. Create a working copy(a local copy) of the repository/website in your webserver by performing a svn
    checkout.
  2. you can setup a task in cron/scheduler (depending on linux/windows). The task can do a
    svn update in your working copy. This can be done every few mins/hours, depending on the frequency of your commits.
  3. Direct your webserver not to display .svn dirs. In case of apache, you can include the below lines in to your httpd.conf (there should be a way in IIS too, let me know if you need this for windows)
<DirectoryMatch \.svn>
   Order allow, deny
   Deny from all
</DirectoryMatch>

AliasMatch \.svn /non-existant-page
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文