Subversion for Designers? For Clients?
One of the great things about subversion is that you can have a centralized repository of resources with the ability to access any version and to handle branching and merging. It's also fairly straightforward to create an automated build process for testing and production servers, but how do you incorporate assets that you don't control into the build?
Dealing with Designers
We build most of our apps for agencies/design firms who often then want to be able to customize the view templates using something like Dreamweaver to tweak the look and feel of the HTML and css to meet their end clients needs. This is great as it means we don't have to deal with small look and feel changes (which can be a real time sink), but we run into issues with overwriting of templates because even though we make heavy use of view helpers to abstract logic, sometimes we have to make changes to the same templates our design partners are working on and occasionally that becomes an issue.
At first, the solution seemed obvious - move the templates to source control. Unfortunately, for people you don't control and who have no background in software, persuading them to use a svn plugin for Dreamweaver and then to fire off an Ant build task to see every tiny change they make in a template is a hard sell. Also, with the number of small changes they make, the number of commits would be an issue. A local development environment is also a non starter as they don't want to mess with web servers locally and often need to show changes in real time to remote end clients.
I've been thinking about setting up a "design server" which would automatically check out a version of the code that they could then work on and I'd run some kind of scheduled task to commit the code every night for which changes had been made or something. That way the designers could continue to use Dreamweaver and FTP to play with the files and I'd hide svn while still getting most of the benefits (they wouldn't be able to roll back to same-day changes, but that hasn't been a request).
Any thought on a seamless way to get HTML designers you don't control or have strong influence over to fit into a source control based workflow?
Coping with Clients
Another issue is finding the best way to handle files uploaded by end clients using a content management system. In some ways it would be very nice to commit such changes to svn as it would allow for svn to provide full snapshots of the entire web application and would mean that automated builds from svn could be used for recovery if a web server failed.
The other approach would be to have a separate solution for backing up client files, but it seems a little strange to have two separate backup/snapshot solutions which would then need to be manually synchronized to successfully restore a server - one for code and another for other files/assets. I suppose again the other solution would be to treat a certain directory on the production server as a checkout from svn and to automatically commit to source control for every day that files had changed.
Any thoughts on the practicalities of automating commits? Any thoughts on mixing up template, code and possibly file commits into a single system? On the one hand it would be nice to have a central repository of everything required to rebuild a site - on the other would the code changes and commits be overwhelmed by all of the noise being generated by the automated file and template commits?
Any thoughts appreciated!



In regards to file uploads, etc we discussed this recently having lost some files a client uploaded. We discussed putting these into SVN but we have some applications that have literally thousands of files. After some discussion we decided (for now) that only code related to building the core application should be stored in SVN. Uploaded files, and data stored in the db should be handled independently.
I agree it does sound nice to deploy an entire snapshot of an application at any point in time though... :) Will be interested to hear what others have to say on this...
@Jim, Yeah, on balance we're gonna use svn for code (including templates) and just rsynch or similar to handle the file backups. Not quite as neat, but a little more practical.
Regarding files uploaded using CMS I would consider if it's possible to have database as central storage for files as well as any other data changed using CMS. URLs would have to point to some script that checks if there is cached copy somewhere and if not go to database and get it. As long as amount of data is reasonable this works pretty well and clarifies backups a lot.
One thing we are considering is relatively powerful box running dedicated development servers for each person who needs it using VMware. This would reduce local workstation memory etc. requirements and make it really easy deploy new development servers when needed. Related plan is to use svn for all web server configuration data - most likely this would have to be done with some kind of combination of svn and Ant script that actually configures/reconfigures specific server instance.
If your designers are using adobe products this could be an option as it hooks directly into adobe file dialogues. I'm not sure about integrating with non adobe products though which may be an issue.
If I understood correctly, your build depends on files maintained by your developers and on files maintained by outside designers you have no control over.
And both these files together belong to the same branch right? So this is not about creating branch-specific builds and the designer-maintained files belong to a different branch?
And the problem is that the designers (presumably) can't publish their work directly to svn. Instead they coordinate their own work as they see fit and eventually publish the results via ftp.
And, in order to ensure repeatability, each file consumed by the build script should be versioned in the same branch of the same repository (so each build corresponds exactly to one revision of the repository with no exceptions whatsoever), and that's why your developers need to commit the files from the ftp server to svn and forcing the build script to read files only from svn. Right?
Someone posted his concerns about conflicts. There is no way around it: if the designers maintain unmergeable files, they need to coordinate their work somehow. And assuming they used svn, svn just reveals any problems they might have in the way they coordinate their work. Svn doesn't introduce any new complexity.
Without svn the designers need to fetch the current version from somewhere (ftp get?), tell other designers not to work on it (email?), modify the file, and publish it (ftp put?).
I don't see how svn makes this different or more complicated: just
s/ftp get/svn update/
s/email/svn lock/
s/ftp put/svn commit/
So maybe the designers could learn to live with svn. I admit I have no experience on this, this is just speculation.
I hope I understood the problem correctly and this helps.
The designers are used to FTPing into live server and making tweaks there. That is where the idea comes of giving them a test server that is then automatically committed every evening where there was at least some kind of change. It does leave the issues of what to do if manual merges are required though . . .
Interesting! Just had a look at the product:
http://www.adobe.com/products/creativesuite/versio...
Main issue is a little bit of reluctance to add another moving part (and one that would be DW dependent - although most of our design partners do use DW). Also would be a little annoying personally as when I make changes I use CF Eclipse! Would also have to look into stuff like automating builds (It's Java so I'm guessing Ant integration wouldn't be a big deal).
Definitely an interesting approach!
Do the designers really need the whole deployed server for making UI tweaks? I have found that with a mock server it's even easier to reproduce certain error flows etc.
If the do need the whole server, then their workspace is actually split between their own workstation and the deployed server. They modify the files locally and view the results remotely, and some synchronization magic happens in between.
The local part could be a svn working copy, and the synchronization between the parts would be easy to automate (ftp, scp, ...), and the script would be fast.
The number of commits wouldn't increase, because the designer can make lots of synchronizations before commiting the svn working copy half of his/her workspace.
Taking things a little further, the target for synchronizing the local working copy to the server could be the same target that does the full deployment, with proper use of the uptodate task of ant and some timestamp generating. (Even with Windows, a "give me all classes and test statuses" run of a workspace of almost 200 projects is a matter of seconds when everything is uptodate.) But maybe this isn't needed.
Hmmm . . .
So now they can add images and edit css files. No template mods though. If they edit the sample html file the y ll need to pass it to the devs for them to integrate new layout elements into the real templates.
When they get to a satisfactory result on their local copy they can ftp copy the local images and modded css files to the server. Instant live preview. Server holds a svn working copy. You have a midnight commit that would put their new images and css mods to svn so the devs get them too.
Just a though as I'm stuck in svn land with my designers right now too :)