Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 61 lines (47 sloc) 2.365 kb
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
1 GitHub Services
2 ===============
3
4 How the services work
5 ---------------------
6
5df4423 @tekkub Pull requests are better
tekkub authored
7 1. A post-receive background job is submitted when someone pushes their
ea9e072 @defunkt whitespace
defunkt authored
8 commits to GitHub
9 2. If the repository the commits belong to has any "Service Hooks" setup, the
10 job makes a request to `http://services-server/service_name/` with the
11 following data:
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
12 - `params[:payload]` containing all of the commit data (the same data you get using the API)
13 - `params[:data]` containing the service data (username, password, room, etc)
ea9e072 @defunkt whitespace
defunkt authored
14 3. Sinatra (github-services.rb) processes the request (twitters your data, says
15 something in campfire, posts it to lighthouse, etc)
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
16 4. Rinse and repeat
17
18 Steps to contributing
19 ---------------------
20
21 1. Fork the project
ea9e072 @defunkt whitespace
defunkt authored
22 2. Create a new file in /services/ called `service_name.rb`, using the following
23 template:
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
24
25 service :service_name do |data, payload|
26 end
27
ea9e072 @defunkt whitespace
defunkt authored
28 3. Vendor any external gems your code relies on, and make sure to include it in
29 the requires at the top of github-services.rb
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
30 4. Add documentation to `docs/service_name` (refer to the others for guidance)
ea9e072 @defunkt whitespace
defunkt authored
31 5. Add your name to the `CONTRIBUTORS` file
5df4423 @tekkub Pull requests are better
tekkub authored
32 6. Send a pull request from your fork to [github/github-services](https://github.com/github/github-services)
ea9e072 @defunkt whitespace
defunkt authored
33 7. Once it's accepted we'll add any new necessary data fields to the GitHub
34 front-end so people can start using your addition.
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
35
82160c5 @pjhyett break out contributors into a separate file
pjhyett authored
36 *Patches including tests are encouraged*
e987d7d @dag Mark up README with markdown and rename accordingly
dag authored
37
db8f6f1 @pjhyett run instructions
pjhyett authored
38 Running the server locally
39 --------------------------
40
41 1. [sudo] gem install hpricot
88c183f @technoweenie change of address
technoweenie authored
42 2. git clone git://github.com/github/github-services.git
db8f6f1 @pjhyett run instructions
pjhyett authored
43 3. cd github-services
44 4. ruby github-services.rb
45
ed14c72 @pjhyett be specific on bug reporting
pjhyett authored
46 * Bugs in the code should be filed under the Issues tab
5df4423 @tekkub Pull requests are better
tekkub authored
47 * Problems with the service hooks can be filed [here](http://support.github.com/discussions/post-receive-issues)
0d82100 @jessmartin Added instructions for how to test a service
jessmartin authored
48
49 How to test your service
50 ------------------------
51
ea9e072 @defunkt whitespace
defunkt authored
52 1. Start the github-services Sinatra server with `ruby github-services.rb`. By
53 default, it runs on port 8080.
54 2. Edit the doc/github_payload file as necessary to test your service. (Usually
55 just editing the "data" values but leaving the "payload" alone.)
56 3. Send the doc/github_payload file to your service by calling:
5df4423 @tekkub Pull requests are better
tekkub authored
57 `./script/deliver_payload [service-name]`
12cca17 @defunkt point out RunCodeRun => run_code_run
defunkt authored
58
59 NOTE: The name of the service and your docs/ file matters. If your service is RunCodeRun, your service
60 and docs MUST be `run_code_run`. Good luck!
Something went wrong with that request. Please try again.