SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

Stack Overflow


The old fashioned way

RECENT TUNES

July 31, 2009 – 12:28pm Springloops deployment with svn externals

We’ve been trying out springloops as a hosted svn solution for one of our smaller projects, and so far it does the job just fine. We are using it to host the subversion repository for a symfony project. We generally like to use svn:externals for the symfony library files themselves, this way it its easy to upgrade symfony, make sure every deployment has the necessary code base without having to worry about having PEAR installed on every server.

Springloops has a feature that will automatically copy your latest code to a server you specify, either automatically with every commit, or manually whenever you need it. Immediately I ran into a problem: Springloops will not fetch any code in an external repository and copy it to your server. This means that when we tried to auto-deploy our little app, all of the symfony files were missing!

Here is what their support (which was speedy, I might add, even for a free account like ours) says:

Unfortunately deploying externals is not supported at the moment. The reason is it slows down the entire process because our engine would have to download changelog and file contents from remote servers. We are working on a solution to speed it up, but for now you will have to upload it manually just like you said. You might consider using svn export rather than checkout to avoid placing “.svn” control directories on your server.

Good to know. So, given that information, here is a list of possible ways to easily deploy changes to your project:

  • Use rsync. With symfony this is easy with the “project-deploy” command line tool. This is my preferred method because it’s just so darn easy, and lets me get away upload changes that aren’t yet committed to svn (gasp).
  • Checkout a version of your project from SVN on your server. When it comes time to upgrade, do an “svn up” or “svn switch” to get the latest changes or switch to another tagged release.
  • Do an svn export as suggested by the support guy to avoid placing the “.svn” directories on the server. If you don’t prevent access to these directories on your web server, it can pose a serious risk.
Posted by in  Uncategorized   |  

6 Responses to Springloops deployment with svn externals

  1. Tom says:

    Hey guys,

    I’ve just signed up with Springloops too, and have just come across the svn:externals limitation. It wouldn’t be too much trouble to upload the main symfony library now and again, but I also use externals for plugins, so keeping track of all the changes would be a pain in the arse. But it’s good to hear that they have a solution in the pipeline.

    My question to you, and anyone else, who would like to comment is: the problem with deploying directly from Springloops is that you’d miss out on all the autogenerated model classes. I know that it’s not ‘done’ to include autogenerated files in an svn repo, but would it cause a huge problem if I did? Since I am using the Rackspace Cloud, Springloops is a very attractive solution — they don’t offer rsync.

    Anyway, I’d love to hear your/others’ thoughts.

    Cheers,

    Tom

  2. Scott Meves says:

    Tom, it’s common to have a post-deployment script activated that would get triggered by springloops after it gets done copying your files. This script of yours could be used to rebuild your models, run db migrations, etc.

    I don’t mind having all of the generated classes in SVN except that each time you rebuild your model with a slight change, *all* of those model files get a new timestamp and end up showing up as modified files in that checkin, which is annoying. But no, it wouldn’t be a huge problem.

  3. Tom says:

    Yeah, I see they ask for a url that they would trigger after each deployment. So, could I run all the symfony tasks from there? Or is that a really obvious security threat?

  4. Scott Meves says:

    It could be a security issue, however you could populate your URL with a secret key as a GET parameter and then set up your script on your server to only accept requests if the key matches. This key may show up in your web server logs, but hopefully those logs are secure anyway.

    I haven’t figured out a way to get access to any hooks (like post-commit) in the springloops repository, but if you are hosting your own svn server that works well, too.

  5. I read this blog all the time. So strange that I only just now noticed that you sometimes use Springloops. I’ve been using Springloops since early 2007, but I know very few other people who use it.

    I’ve been thinking of switching to Github, but I have a lot of projects that depend on Springloops auto-deploy export feature. It is very handy.

  6. Cantek says:

    Hi,
    I was looking for reviews about Springloops since I am in need for an external versioning tool for our magento project. I see the last comment was on 2010 but still if you can share your ideas for the current version of springloops it would be really great.