Subversion integration with Active Reload’s wonderful Lighthouse Issue Tracking site.

I realize this post is probably not as interesting as integrating Lighthouseapp with GIT but I thought I would jot down a couple of notes.

There is a great script that shows you how to set up subversion with lighthouse here:

http://www.lighthouseapp.com/help/setting-up-subversion-integration

The documentation is sufficient, but too sparse for my tastes.

Here’s some notes that might help you.

1. First of all, you’ll need to know where your subversion repository is stored on your server. Let’s say its in: /svn/repos

2. In that folder there should be another folder called “hooks”. You’ll need to create a file called “post-commit” in this directory, if there isn’t one already. In that empty file put the following:


#!/bin/sh

REPOS="$1"
REV="$2"

/svn/repos/hooks/lighthouse.rb "$REPOS" "$REV"

4. Next, copy the script from the link at the top of this page to a file called “lighthouse.rb” in the /svn/repos/hooks/ directory. You’ll need to change a few things in this file. You’ll need to set the token to the api token you created on lighthouseapp. I’m not entirely sure what the seperate user tokens that follow that are for…ours seems to work fine without each user having their own token. “Account” is the the base url of your lighthouseapp page. Should be something like ‘http://mycompany.lighthouseapp.com’. The project number, which the author claims is self expanatory, is the number that you find in the URL when you are looking at a particular issue. For instance, your URL might look like this:

http://mycompany.lighthouseapp.com/projects/8958-launch/overview

You want the 8958 from here…you don’t want to include the “-launch” part. I disabled the “prefix:” option by deleting this line completely, and removing the comma from the previous line.

5. Finally, you have to make sure that your permissions on your post-commit and your lighthouse.rb file are executable. To test, you could do a chmod 777 lighthouse.rb and chmod 777 post-commit. You’ll want to set these more strictly once you have your server set up.

6. That’s it. You should be able to run

./post-commit /svn/repos 200

from your hooks directory (200 is the number of an existing revision in your subversion repository), and it should run. On lighthouse, you should see a new entry that says “changeset” with information about the revision, and who made it. Any new commits with now show up in lighthouse as well.

picture-3.png

Comments (5) left to “Subversion integration with Active Reload’s wonderful Lighthouse Issue Tracking site.”

  1. Aline Freitas wrote:

    Great! You saved my life! I wouldn`t manage to do it only by the lighthouse docs. Thank you!

  2. Jon H wrote:

    Also, if you aren’t using usernames, don’t remove the line in its entirety like I did, you’ll just get a ‘Error: undefined method ‘[]‘ for nil:NilClass trace:

    Instead, change it to :users => {},

  3. G_i_N wrote:

    да можно угарнуть)))!!!!

  4. phil g wrote:

    I’m trying to set this up but nothing I do seems to work. I did everything just like you said and the lighthouse.rb runs all the way through (I can tell because I put a print “123″ at the bottom of it and it printed out). But it doesn’t add any messages to lighthouse. Where should the notifications show up? Do I need to specify in my commits what ticket to append it to? Do I need to have the paid version in order for this to work?

  5. phil g wrote:

    Actually I was wrong there. If I put ‘print “123″‘

    req = Net::HTTP::Post.new(url.path)
    req.basic_auth token, ‘x’ # to ensure authentication
    req.body = changeset_xml.strip
    print ‘123′ #<——here, after these three lines, or anywhere after that, it won't print, so something is up, puttinit on the previous line will work fine

Post a Comment

*Required
*Required (Never published)