We have a standard directory structure for each of our projects:
-
projectname
-
/docs
-
/testing
-
/build
-
/priv
-
/pub
Testing contains our Selenium scripts (and in the future - unit testing scripts). Build contains our Ant scripts.
At the office I'm in charge of setting up new SVN repositories and one of the things I've done to speed up setting up new projects is to create a 'template' project directory. This contains all the folders listed above along with some default buildfile and testing scripts.
I first created this layout in a new repository. I then added our standard buildfiles and testing suite files. I then created a SVN dumpfile using the svnadmin dump command. You end up with a dumpfile containing the contents of your repository.
Now when I create a new project I simple create the new project's repository, and then use the svnadmin load command to import my 'default' dumpfile contents.
-
/usr/bin/svnadmin create --fs-type fsfs /var/www/svn/projectname
-
sudo chown -R apache:apache /var/www/svn/projectname
-
sudo svnadmin load /var/www/svn/projectname </var/www/svn/tmp/template.dumpfile --ignore-uuid -q
Now when the first person checks out the project - they already have the required directory structure, buildfiles and testing templates.
You May Also Enjoy Reading:
3 Comments
It’s always funny to read your posts about the same technologies I use. Seems our methods are almost always the same or nearly so. In my case I have one repository with multiple project directories. One of those projects is named “.template” (so that it appears at the top of any listing and to denote its status as a non-active- or hidden - project). When I need a new project, I just copy the contents of .template:
svn cp -m “Copying base structure from the template” .template mynewproject
I also keep a lot of core directories and files (e.g. build.xml.sample, _global.css) in my template. As long as I keep the template project up to date, any new projects will always get the latest. It’s a very convenient system.
@Rob - Hopefully we’re doing it the right way
Your system sounds very similar - and much easier in your one repo/multi-project environment. At some point I need to build a little script so I can just go ‘create projectname’ and it’ll run everything for me…
I worked with my sys admin to do just that. The script creates the new environment, scripts out a new Trac project (with permissions set) and links the two. Quick and easy. Can’t beat that, right?
Creative Commons License