|
1 |
| -Get Zulip notifications for your Git repositories! |
| 1 | +# Zulip Git integration |
2 | 2 |
|
3 |
| -1. {!create-an-incoming-webhook.md!} |
| 3 | +Get Zulip notifications for pushes to your Git repositories! |
4 | 4 |
|
5 |
| -1. {!download-python-bindings.md!} |
| 5 | +Note that Zulip also offers integrations for [GitHub](./github), |
| 6 | +[GitLab](./gitlab) and various other |
| 7 | +[version control hosting services][other-integrations]. |
6 | 8 |
|
7 |
| -1. {!create-channel.md!} |
| 9 | +!!! warn "" |
8 | 10 |
|
9 |
| -1. {!change-zulip-config-file.md!} |
| 11 | + **Note:** This integration adds a `post-receive` hook to your Git |
| 12 | + repository on your Git server. |
10 | 13 |
|
11 |
| - You may also need to change the value of `STREAM_NAME`. |
| 14 | +{start_tabs} |
12 | 15 |
|
13 |
| - You can specify the branches that will be used for notifications by modifying |
14 |
| - the `commit_notice_destination` function. By default, |
15 |
| - pushes to the `main`, `master`, and `test-post-receive` branches will result in a |
16 |
| - notification. |
| 16 | +1. {!create-an-incoming-webhook.md!} |
17 | 17 |
|
18 |
| -1. Symlink `/usr/local/share/zulip/integrations/git/zulip_git_config.py` |
19 |
| - to the `.git/hooks` directory of your Git repository. |
| 18 | +1. {!download-python-bindings.md!} |
20 | 19 |
|
21 |
| -1. Symlink `/usr/local/share/zulip/integrations/git/post-receive` |
22 |
| - to the `.git/hooks` directory of your Git repository. |
| 20 | +1. If your Git server and your Zulip server are on the same machine, |
| 21 | + symlink the `post-receive` hook of your Git repository in your Git |
| 22 | + server by running: |
| 23 | + |
| 24 | + `ln -s {{ integration_path }}/post-receive your-repo.git/hooks/post-receive` |
| 25 | + |
| 26 | + Otherwise, copy the `post-receive` hook to your Git repository's |
| 27 | + `/hooks` directory. |
| 28 | + |
| 29 | + The `post-receive` hook is triggered on every push to the repository. |
| 30 | + |
| 31 | +1. {!change-zulip-config-file.md!} |
| 32 | + |
| 33 | +1. Copy the config file to the same directory as the `post-receive` hook. |
| 34 | + |
| 35 | + `cp {{ config_file_path }} your-repo.git/hooks` |
23 | 36 |
|
24 | 37 | !!! tip ""
|
25 | 38 |
|
26 |
| - You can test the plugin without changing your `main` branch by |
27 |
| - pushing to the `test-post-receive` branch. |
| 39 | + Use the `test-post-receive` branch to test the integration without |
| 40 | + modifying your `main` branch. |
| 41 | + |
| 42 | +{end_tabs} |
| 43 | + |
| 44 | +### Configuration options |
| 45 | + |
| 46 | +In `{{ config_file_path }}`, you can set: |
| 47 | + |
| 48 | +- The channel where notifications are sent by updating the value of |
| 49 | + `STREAM_NAME`. By default, notifications are sent to a channel named |
| 50 | + "commits". |
| 51 | + |
| 52 | +- Which branches send notifications when pushed by updating the |
| 53 | + `commit_notice_destination` function. By default, pushes to the `main`, |
| 54 | + `master`, and `test-post-receive` branches will result in notifications. |
28 | 55 |
|
29 |
| -{!congrats.md!} |
| 56 | +- The message format used in your Zulip notifications by updating the |
| 57 | + `format_commit_message` function. |
30 | 58 |
|
31 |
| - |
| 59 | +[other-integrations]: ../version-control |
0 commit comments