自动检测 FTP 上传并将其提交到 SVN

发布于 2024-08-09 19:19:11 字数 210 浏览 2 评论 0原文

也许这个问题更适合服务器故障,但无论如何我都会先在这里尝试...

是否有一种方法可以检测用户何时将文件上传到服务器并自动将该文件签入源代码管理?这是在带有 WebStack 的 Solaris 10 服务器上。

我知道这可以反过来,但我真的很想这样做。原因是公司现在刚刚转向使用 SVN,我们希望通过不剥夺所有老开发人员(主要是业余开发人员)以前的工作方式来让他们感到舒适。

Perhaps this question is more suited for serverfault, but I'm going to try here first anyway...

Is there was a way to detect when a user uploads a file to a server and automatically check that file into source control? This is on a Solaris 10 server with WebStack.

I know that this is possible in reverse, however I'd really like to do it this way. The reason for this is that the company is just now moving to use SVN and we'd like to keep all the old developers (largely amateur) somewhat comfortable by not taking away the way they used to do things.

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

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

发布评论

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

评论(4

白云不回头 2024-08-16 19:19:11

在您的情况下可能有趣的一件事。可以将通过 Apache 服务器提供的 svn 存储库映射到 Windows 中的简单网络文件夹(如果我没有弄错的话,它与最新版本的 SVN 中的 WebDAV 协议支持有关)。

因此,如果您的开发人员使用 Windows 资源管理器将文件上传到 FTP,他们可能会切换到这种方式,而不会注意到差异。因此根本不需要 FTP。

One thing that may be interesting in your situation. It's possible to map svn repository provided through Apache server to a simple network folder in Windows (if I don't mistake it's related to WebDAV protocol support in last versions of SVN).

So if your developers were using Windows explorer to upload files to FTP, they may just switch to this way without noticing difference. So no FTP will be needed at all.

风追烟花雨 2024-08-16 19:19:11

我相信你想要的是 自动版本控制

...此功能的用例对于与非技术用户一起工作的管理员来说非常有吸引力。想象一下运行 Microsoft Windows 或 Mac OS 的普通用户的办公室。每个用户都会“挂载”Subversion 存储库,它看起来是一个普通的网络文件夹。他们像往常一样使用共享文件夹:打开文件、编辑文件并保存文件。同时,服务器会自动对所有内容进行版本控制。任何管理员(或知识丰富的用户)仍然可以使用 Subversion 客户端来搜索历史记录并检索旧版本的数据。

不过,它需要您通过 Apache 服务器(使用 mod_dav_svn 模块)使 SVN 服务器可用。

I belive what you want is Autoversioning:

...the use case for this feature can be incredibly appealing to administrators working with non-technical users. Imagine an office of ordinary users running Microsoft Windows or Mac OS. Each user “mounts” the Subversion repository, which appears to be an ordinary network folder. They use the shared folder as they always do: open files, edit them, and save them. Meanwhile, the server is automatically versioning everything. Any administrator (or knowledgeable user) can still use a Subversion client to search history and retrieve older versions of data.

It would require you to make your SVN server available via an Apache server (using the mod_dav_svn module), though.

人间☆小暴躁 2024-08-16 19:19:11

您可能更擅长服务器故障。基本上你想挂钩 ftp 上的上传完成事件,那么你需要做的就是在该目录中运行 svn ci ,假设开发人员上传的目录是 svn 树的签出目录。

编辑
我过去所做的是使用 Apache FTP 服务器,它是一个纯 java ftp。它允许您编写 ftplets 来监听上述事件。您只需扩展类 DefaultFtplet 并实现 onUploadEnd、onRenameEnd、onDeleteEnd。对于每个事件,您将执行一些 svn 命令,无论是更新、删除还是添加。

在我原来的公司,我们使用将新工件上传到 ftp 来触发 hudson 中的构建。

You're probably better on serverfault. Basically you want to hook into an upload complete event on the ftp then all you will need to do is run svn ci in that directory assuming that the directory into which the devs are uploading is a checkout of the svn tree.

Edit
What I have done in the past is use the Apache FTP server which is a pure java ftp. It allows you to write ftplets which can listen on events like the above. You would just extend the class DefaultFtplet and implement onUploadEnd, onRenameEnd, onDeleteEnd. For each event you would exec some svn command be it update, delete or add.

At my old company we used the upload of a new artifact to the ftp to trigger a build in hudson.

一城柳絮吹成雪 2024-08-16 19:19:11

我的一位同事发现了 文件事件通知,它基本上是 Solaris 的 inotify(如我明白了)。我们的研究尚未取得任何进展,但一旦取得进展,我将在此处标记适当的答案。

One of my co-workers discovered File Events Notification which is basically inotify for Solaris (as I understand it). We haven't progressed any farther with the research, but once we do, I'll mark the appropriate answer here.

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