English 中文(简体)
Automatically detecting an FTP upload and committing it to 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.

问题回答

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.

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.

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.

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.





相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签