Leeroy needs to be configured to point to your GitHub repositories,to your Jenkins server and its jobs. Leeroy will attempt to automaticallyinstall the GitHub hook for you. You will also need to configure yourJenkins jobs to pull the right repositories and commits.

### Leeroy Configuration

You may either edit the `leeroy/settings.py` file or create a new file andset the `LEEROY_CONFIG` environment variable to point to that file. Itshould look something like:

```python

DEBUG = TrueLOGGING_CONF = "logging.conf"LOGGER_NAME = "leeroy"

# The hostname (and :port, if necessary) of this serverSERVER_NAME = "leeroy.example.com"

# The hostname (and :port, if necessary) of the server GitHub should send# notification to. It can be different from SERVER_NAME when another server is# proxying requests to leeroy. Falls back to SERVER_NAME if not provided.# GITHUB_NOTIFICATION_SERVER_NAME = "leeroy.example.com"

# Whether a Jenkins job is created for each commit in a pull request,# or only one for the last one.# What commits to build in a pull request. There are three options:# 'ALL': build all commits in the pull request.# 'LAST': build only the last commit in the pull request.# 'NEW': build only commits that don't already have a commit status set. (default)BUILD_COMMITS = 'NEW'

2. Create a Jenkins job. Under "Job Notifications", set a NotificationEndpoint with protocol HTTP and the URL pointing to `/notification/jenkins`on your Leeroy server. If your Leeroy server is `leeroy.example.com`, setthis to `http://leeroy.example.com/notification/jenkins`.

3. Check the "This build is parameterized" checkbox, and add 4 stringparameters: `GIT_BASE_REPO`, `GIT_HEAD_REPO`, `GIT_SHA1`, and `GITHUB_URL`.Default values like `username/repo` for `GIT_BASE_REPO` and `GIT_HEAD_REPO`,and `master` for `GIT_SHA1` are a good idea, but not required.

Ensure that the GitHub hook has been installed by visiting`https://github.com/<user>/<repo>/admin/hooks` for your project, or bychecking the Leeroy logs.

Submit a pull request for one of your watched GitHub repositories. Youshould shortly see a build scheduled for its corresponding Jenkins job.Soon after that, you should see a "pending" status on the pull requestin GitHub. Once the build finishes, you should see either a "success"or "failure" status on your pull request. Congratulations!

If you want to run Leeroy in a more production-ready environment then anyWSGI app server should work. We are fans of[uwsgi](http://projects.unbit.it/uwsgi/).

## Contribution

Contributions are welcome! Here's the best way to do that:

1. Fork the repo2. Make your changes, preferably in a feature branch on your repo. Don'tforget to update the AUTHORS.md file!3. Submit a pull request

Please make sure that `python setup.py test` does not return any PEP-8 orpyflakes errors before submitting your pull request.

## FAQ

### Why is this a server instead of a Jenkins plugin?

The honest answer is that I spend most of my day developing a Flaskapplication in Python, and that's the environment I have set up, feelvery comfortable in, and where I knew I could get something up andrunning quickly.

The delusional answer is that this makes it possible to integrateother CI services fairly easily in the future.

### What's with the name Leeroy?

[Know your meme.](http://knowyourmeme.com/memes/leeroy-jenkins)

## Copyright and License

Leeroy is Copyright (c) 2012 litl, LLC and licensed under the MIT license.See the LICENSE file for full details.