自动检测 FTP 上传并将其提交到 SVN
也许这个问题更适合服务器故障,但无论如何我都会先在这里尝试...
是否有一种方法可以检测用户何时将文件上传到服务器并自动将该文件签入源代码管理?这是在带有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在您的情况下可能有趣的一件事。可以将通过 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.
我相信你想要的是 自动版本控制:
不过,它需要您通过 Apache 服务器(使用
mod_dav_svn
模块)使 SVN 服务器可用。I belive what you want is Autoversioning:
It would require you to make your SVN server available via an Apache server (using the
mod_dav_svn
module), though.您可能更擅长服务器故障。基本上你想挂钩 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.
我的一位同事发现了 文件事件通知,它基本上是 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.