{"id":13827666,"url":"https://github.com/docker-archive/leeroy","last_synced_at":"2025-07-09T04:33:03.863Z","repository":{"id":27211628,"uuid":"30682536","full_name":"docker-archive/leeroy","owner":"docker-archive","description":"Jenkins integration with GitHub pull requests","archived":true,"fork":false,"pushed_at":"2017-03-15T20:33:16.000Z","size":158,"stargazers_count":177,"open_issues_count":9,"forks_count":44,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-08-05T09:16:25.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docker-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-12T03:00:06.000Z","updated_at":"2023-09-08T16:54:38.000Z","dependencies_parsed_at":"2022-08-31T17:21:26.356Z","dependency_job_id":null,"html_url":"https://github.com/docker-archive/leeroy","commit_stats":null,"previous_names":["jfrazelle/leeroy","docker/leeroy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fleeroy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fleeroy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fleeroy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker-archive%2Fleeroy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker-archive","download_url":"https://codeload.github.com/docker-archive/leeroy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225486385,"owners_count":17481886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:02:04.812Z","updated_at":"2024-11-20T07:30:54.058Z","avatar_url":"https://github.com/docker-archive.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"## Leeroy: Jenkins integration with GitHub pull requests\n\n[![Circle CI](https://circleci.com/gh/docker/leeroy.svg?style=svg)](https://circleci.com/gh/docker/leeroy)\n\nLeeroy is a Go application which integrates Jenkins with \nGitHub pull requests.\nLeeroy uses [GitHub hooks](http://developer.github.com/v3/repos/hooks/) \nto listen for pull request notifications and starts jobs on your Jenkins \nserver.  Using the Jenkins notification plugin, Leeroy updates the \npull request using GitHub's \n[status API](http://developer.github.com/v3/repos/statuses/)\nwith pending, success, failure, or error statuses.\n\nThis is based off the python project [leeroy](https://github.com/litl/leeroy),\nbut has a few custom updates to meet our needs, including custom build\nendpoint, DCO checking, issue labeling, etc.\n\n### Configuration\n\nLeeroy needs to be configured to point to your GitHub repositories,\nto your Jenkins server and its jobs.  You will need to add a GitHub \nwebook pointing towards your leeroy instance at the endpoint \n`/notification/github`. You will also need to configure your\nJenkins jobs to pull the right repositories and commits.\n\n#### Leeroy Configuration\n\nBelow is a sample leeroy config file:\n\n```\n{\n    \"jenkins\": {\n        \"username\": \"leeroy\",\n        \"token\": \"YOUR_JENKINS_API_TOKEN\",\n        \"base_url\": \"https://jenkins.dockerproject.com\"\n    },\n\n    // Whether a Jenkins job is created for each commit in a pull request,\n    // or only one for the last one.\n    // What commits to build in a pull request. There are three options:\n    // \"all\": build all commits in the pull request.\n    // \"last\": build only the last commit in the pull request.\n    // \"new\": build only commits that don't already have a commit status set.\n    \"build_commits\": \"last\", // (default)\n\n    \"github_token\": \"YOUR_GITHUB_TOKEN\",\n    \"github_user\":  \"GITHUB_USER_FOR_ABOVE_TOKEN\",\n\n    // A list of dicts containing configuration for each GitHub repository \u0026\n    // Jenkins job pair you want to join together.\n    \"builds\": [\n        {\n            \"github_repo\": \"docker/docker\",\n            \"jenkins_job_name\": \"Docker-PRs\",\n            \"context\": \"janky\" // context to send to github for status (if you\n            wanna stack em)\n        }\n    ],\n\n    // Basic Auth for endoints\n    \"user\": \"USER\",\n    \"pass\": \"PASS\"\n}\n```\n\n#### Jenkins Configuration\n\n1. Install the Jenkins [git plugin][jgp] and [notification plugin][jnp].\n\n2. Create a Jenkins job.  Under \"Job Notifications\", set a Notification\nEndpoint with protocol HTTP and the URL pointing to `/notification/jenkins`\non your Leeroy server.  If your Leeroy server is `leeroy.example.com`, set\nthis to `http://leeroy.example.com/notification/jenkins`.\n\n3. Check the \"This build is parameterized\" checkbox, and add 4 string\nparameters: `GIT_BASE_REPO`, `GIT_HEAD_REPO`, `GIT_SHA1`, and `GITHUB_URL`.\nDefault values like `username/repo` for `GIT_BASE_REPO` and `GIT_HEAD_REPO`,\nand `master` for `GIT_SHA1` are a good idea, but not required.\n\n4. Under \"Source Code Management\", select Git.  Set the \"Repository URL\" to\n`git@github.com:$GIT_HEAD_REPO.git`.  Set \"Branch Specifier\" to `$GIT_SHA1`.\n\n5. Configure the rest of the job however you would otherwise.\n\n[jgp]: https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin\n[jnp]: https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin\n\n\n### Usage\n\n```console\n$ leeroy -h\nUsage of leeroy:\n  -cert=\"\": path to ssl certificate\n  -config=\"/etc/leeroy/config.json\": path to config file\n  -d=false: run in debug mode\n  -key=\"\": path to ssl key\n  -port=\"80\": port to use\n  -v=false: print version and exit (shorthand)\n  -version=false: print version and exit\n```\n\n### License\n\nMIT. See [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker-archive%2Fleeroy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker-archive%2Fleeroy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker-archive%2Fleeroy/lists"}