Code/HowToUseCodehostingLocally

Not logged in - Log In / Register

Revision 1 as of 2009-07-21 05:44:31

Clear message

How To Use Codehosting Locally

Just as it's possible to run the launchpad web application locally, it is also possible to run the complete codehosting stack on your development machine. The main awkwardness is that you have to manually kick off some of the things that are usually done by cronjobs.

Make sure Apache is set up

Various parts of the codehosting system require that Apache is configured appropriately. If launchpad.dev works at all for you, you've probably already done this, but if it doesn't work, running sudo make install from the root of your launchpad tree should configure things appropriately.

Get things running

Getting all the servers that need to be running started is as simple as running make run_all in the root of your Launchpad tree.

(Intermission)

After make run_all gets going, you might notice that the terminal you're running it it gets filled up with spam like this:

127.0.0.88 - "" "xmlrpc-private.launchpad.dev:8087" [21/Jul/2009:12:02:45 +1300] "POST /mailinglists HTTP/1.0" 200 392 4 0.0119841098785 14 46 "Anonymous" "MailingListApplication:MailingListAPIView" "" "xmlrpclib.py/1.0.1 (by www.pythonware.com)"

You can shut this up by running killall mailmanctl.

Set up a user

Two options. The sensible one is to run ./utilities/make-lp-user <your real launchpad id>, as then you can use lp://dev/ shortcuts.

The other option is to use the only user in the sample data to have an ssh key set up -- 'sabdfl'. Running the rocketfuel-setup script should have set this up for you -- try sftp bazaar.launchpad.dev.

Push up a branch

If you ran make-lp-user, this is just a few more keystrokes than pushing a branch to launchpad:

bzr push -d <some branch> lp://dev/~<you>/+junk/branchname

If you're using the sabdfl account, there's a bit more typing to do:

bzr push -d <some branch> bzr+ssh://bazaar.launchpad.dev/~sabdfl/+junk/branchname

Pull and scan the branch

At this point the branch is just in the 'hosted area', and needs to be pulled (copied to the mirrored area, where anonymous and read only access to the branch is served from) and scanned (data about the branch copied into the Launchpad database).

On production, this happens via the magic of cron. Locally you can make it happen by running make sync_branches.

Now you have a fully working and up-to-date branch -- you should be able to look at the branch page in Launchpad, view the source in codebrowse,