Basecamp SVN Integration
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.
Comments
Comments are closed for this post.
This was written on May, 4 2007 and is filed in code, subversion.
Our Products
Categories
- SEO
- accessiblity
- code
- company news
- django
- gondola
- open source
- portfolio
- presentation
- screencast
- software
- subversion
- trailmapping
- wordpress
Archives
- June, 2009
- April, 2009
- February, 2009
- December, 2008
- November, 2008
- September, 2008
- August, 2008
- July, 2008
Elsewhere
What we’ve been up to online
-
@37signals, seeing a number of 500 errors clicking around Basecamp right now http://skitch.com/t/u7e
Pete, 1 day, 16 hours ago -
Basecamp 500 Internal Server Error
Pete, 1 day, 16 hours ago -
Gmail broke plain text replies. Plz fix! http://bit.ly/43nd3q
Pete, 1 week ago -
Building an Open Source Consulting Company
Pete, 1 week, 3 days ago -
< 30% of applicants correctly followed the instructions. Should have added "attention to detail" & "ability to follow instructions" as reqs
Pete, 1 week, 6 days ago -
Django snippets: Sorl Thumbnail + Amazon S3
Pete, 1 week, 6 days ago -
Lincoln Loop is still looking for a Project Manager. Interested? http://authenticjobs.com/jobs/3688/
Pete, 2 weeks ago -
Use PERT technique for more accurate estimates
Taking a weighted average of the most pessimistic, most optimistic, and most likely estimates of a task to get a realistic estimate of the time it will take.
Pete, 2 weeks, 3 days ago -
Evidence Based Scheduling - Joel on Software
Interesting approach to software estimation.
Pete, 2 weeks, 3 days ago -
Less Wrong: Planning Fallacy
People are terrible planners/estimators and there is evidence to prove it.
Pete, 2 weeks, 3 days ago -
A reminder of how simple business can be when you don't make it complicated - (37signals)
Refreshing, especially after after spending 2 days wading through client contracts and work orders.
Pete, 3 weeks, 5 days ago -
We're looking for a part-time Project Mgr to help us juggle the workload. Interested? info+pm@lincolnloop.com
Pete, 4 weeks, 1 day ago -
pushed to master at lincolnloop/django-protected-files
Pete, 1 month ago -
@richleland do you have libjpeg installed?
Pete, 1 month ago -
I have seen the future and it is Google Wave http://wave.google.com
Pete, 1 month ago


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 :)
I tried to follow this guide and noticed that basecamp no longer has a basecamp.rb file at that path. any ideas around this?
answering my own questions, its been relocated to this link:
http://developer.37signals.com/basecamp/basecamp.rb
hope this helps others!