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 no开发者_Go百科t 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.
精彩评论