Basecamp SVN Integration

Basecamp/SVN As promised, here is the follow-up to the SVN for Web Developers post, Basecamp integration.

Why?

Transparency is very important to my business. The #1 complaint I hear about web developers is that they rarely meet deadlines and the client has no idea what is happening with the work until one day it magically appears. To combat that, I use Basecamp to lay out milestones for all my projects. I’ve found that even if a project takes longer than a client would like, as long as they can count on a date that it will be delivered, they’re happy.

Milestones are usually pretty spread out and don’t give clients a good idea of what I’m doing day-to-day to meet them. Writing each Subversion commit to Basecamp gives my clients quick access to the current status of their project.

How?

Luckily, all the hard work is done for us here. Subversion has a post commit hook to automatically run a script after a commit and a Ruby script has already been built to upload these details to Basecamp. We just have to put all the pieces in place to make it happen.

Since my experience with Subversion and Ruby are both limited, I banged my head against the wall for a while trying to get this to work. Here is my Mac-centric cookbook, but it should be trivial to port to other platforms.

1. Get the Prerequisites

wget http://basecamphq.com/api/basecamp.rb
sudo mv basecamp.rb /usr/lib/ruby/1.8/
wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
tar xvzf rubygems-0.9.2.tgz
cd rubygems-0.9.2.tgz
sudo ruby setup.rb
sudo gem update
sudo gem install xml-simple

2. The Post Commit Script

The original script is here, but it doesn’t work out of the box. I had to change each reference of basecamp_project[‘project-id’] to basecamp_project[‘id’]. I also made some additional changes to give the script prettier formatting in Basecamp and make it more portable between projects. You can download my post-commit.rb here.

To use it, you’ll need to change the constants at the top of the file to match your Basecamp setup. SHOW_CODE_CHANGES will display a list of changed files in the Basecamp message. LOG_PREPEND causes an unordered list to be built from the commit message where ever it encounters a line break followed by two hyphens.

Move it to the hooks folder of your repo and make it executable:

chmod +x post-commit.rb
mv post-commit.rb /[path to svn repo]/hooks/post-commit

Wrap Up

That’s it. Every commit automatically creates a message in Basecamp. Hope you found this helpful. I know it would have saved me a couple of hours.

Reader Comments

  • May 28, 2007 at 3:13 p.m. #
    Wim Leers chimed in with:

    Just wanted to say thanks! :)

    I still have to install the post-commit hook, but the first part went flawlessly so I expect no problems :)

  • January 16, 2008 at 4:09 p.m. #
    Derek P. chimed in with:

    I tried to follow this guide and noticed that basecamp no longer has a basecamp.rb file at that path. any ideas around this?

  • January 16, 2008 at 4:11 p.m. #
    Derek P. responded:

    answering my own questions, its been relocated to this link:
    http://developer.37signals.com/basecamp/basecamp.rb

    hope this helps others!

Comments are closed for this post.

This was written on May, 4 2007 and is filed in code, subversion.

Our Products

Premier Real Estate Websites
Our simple and easy real estate CMS. Now open for full developer access.
Trailmapping
Still in development, Trailmapping is a GPS enabled trail guide and trip logger.

Categories

Archives

Elsewhere

What I’ve been up to online

  • Ever wanted to develop a real estate site, but didn't want to deal with the nuts & bolts? Now's your chance: http://premsites.com/developers
    3 days, 6 hours ago #
  • Core Shutdown
     
    3 days, 13 hours ago #
  • BackwardsIncompatibleChanges is my new best friend http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
    2 weeks ago #
  • @mtrier You'll be lucky to find good snow in Colorado or much of North America that early. Most resorts open around the end of November.
    2 weeks, 2 days ago #
  • My analytics account magically started working agiain today. Thanks lazy web. "A List Apart" link love! http://tinyurl.com/6r7oas
    2 weeks, 6 days ago #
  • Since I started using GAFYD, my Google Analytics account no longer works and Google won't respond to my emails. suggestions?
    3 weeks ago #
  • @twiderrific you have my vote for staying local
    3 weeks ago #
  • Django snippets: Super User Conditional Page Exception Reporting
    debug page for superuser, 500 for everyone else
    3 weeks, 6 days ago #
  • Anybody want to split a hotel room for #DjangoCon?
    4 weeks ago #
  • Just got confirmation I'm on the invite list for #DjangoCon. Being a member does have its benefits. Couch surf or hotel?
    4 weeks ago #
  • Admin Image Widget
    4 weeks ago #
  • Follow @trailmapping for Trailmapping.com updates. Just pushed some slick jQuery into production tonight.
    4 weeks ago #
  • Munin :: com :: djangoproject.com :: trac_tickets
    Graphs of trac tickets for Django
    1 month ago #
  • Automating tests in Django | Eric's Site
    Generate tests by simply clicking through your development site.
    1 month ago #
  • Creator/updater fields for admin
    1 month, 1 week ago #

Interested in working with us?
Fill out the form below or contact us at:

PO Box 774441
Steamboat Springs, CO
80477

970.879.8810
info@lincolnloop.com