Skip to content

Commit d485b31

Browse files
Added documentation about testing the deployment. This fixes #10.
1 parent a4e344c commit d485b31

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.rst

+28-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Dependencies
2525
Setup
2626
=====
2727

28-
You can configure what the application does by copying the sample config file
28+
You can configure what the application does by copying the sample config file
2929
``config.json.sample`` to ``config.json`` and adapting it to your needs:
3030

3131
::
@@ -101,6 +101,11 @@ Not all events have an associated branch, so a branch-specific hook cannot
101101
fire for such events. For events that contain a pull_request object, the
102102
base branch (target for the pull request) is used, not the head branch.
103103

104+
The payload structure depends on the event type. Please review:
105+
106+
https://developer.github.com/v3/activity/events/types/
107+
108+
104109
Deploy
105110
======
106111

@@ -144,7 +149,7 @@ To deploy in a Docker container you have to expose the port 5000, for example
144149
with the following command:
145150

146151
::
147-
152+
148153
git clone http://github.com/carlos-jenkins/python-github-webhooks.git
149154
docker build -t carlos-jenkins/python-github-webhooks python-github-webhooks
150155
docker run -d --name webhooks -p 5000:5000 carlos-jenkins/python-github-webhooks
@@ -159,6 +164,27 @@ You can also mount volume to setup the ``hooks/`` directory, and the file
159164
-v /path/to/my/config.json:/src/config.json \
160165
-p 5000:5000 python-github-webhooks
161166

167+
168+
Test your deployment
169+
====================
170+
171+
To test your hook you may use the GitHub REST API with ``curl``:
172+
173+
https://developer.github.com/v3/
174+
175+
::
176+
177+
curl --user "<youruser>" https://api.github.com/repos/<youruser>/<myrepo>/hooks
178+
179+
Take note of the test_url.
180+
181+
::
182+
183+
curl --user "<youruser>" -i -X POST <test_url>
184+
185+
You should be able to see any log error in your webapp.
186+
187+
162188
Debug
163189
=====
164190

0 commit comments

Comments
 (0)