mirror of https://github.com/zulip/zulip.git
integrations: Update docs for git and codebase.
Doing both as once due to the common dependency on change-zulip-config-file-indented.md.
This commit is contained in:
parent
ad6de6e268
commit
f29b9f14fd
|
@ -1,8 +1,4 @@
|
||||||
On your {{ settings_html|safe }}, create a bot for
|
Open `integrations/{{ integration_name }}/zulip_{{ integration_name }}_config.py`
|
||||||
{{ integration_display_name }}.
|
|
||||||
|
|
||||||
Next, open
|
|
||||||
`integrations/{{ integration_name }}/zulip_{{ integration_name }}_config.py`
|
|
||||||
with your favorite editor, and change the following lines to specify the
|
with your favorite editor, and change the following lines to specify the
|
||||||
email address and API key for your {{ integration_display_name }} bot:
|
email address and API key for your {{ integration_display_name }} bot:
|
||||||
|
|
||||||
|
|
|
@ -1,35 +1,39 @@
|
||||||
|
Get Codebase notifications in Zulip!
|
||||||
|
|
||||||
1. First, create the streams you’d like to use for Codebase notifications. There
|
1. First, create the streams you’d like to use for Codebase notifications. There
|
||||||
will be two types of messages: commit-related updates and issue-related updates.
|
will be two types of messages: commit-related updates and issue-related
|
||||||
After creating these streams (we suggest naming them `codebase commits` and
|
updates. We recommend naming the streams `codebase` and `tickets`, respectively.
|
||||||
`codebase issues`), make sure to subscribe all interested parties.
|
After creating these streams, make sure to subscribe all interested parties.
|
||||||
|
|
||||||
2. {!download-python-bindings.md!}
|
1. {!create-a-bot-indented.md!}
|
||||||
|
|
||||||
3. You will need your Codebase API Username. You can find it in the settings page
|
1. {!download-python-bindings.md!}
|
||||||
of your account, under **API Credentials**.
|
|
||||||
|
|
||||||
4. {!change-zulip-config-file-indented.md!}
|
1. {!change-zulip-config-file-indented.md!}
|
||||||
|
|
||||||
5. Also, edit the following Codebase credentials in `zulip_codebase_config.py`:
|
You may also need to update the value of `ZULIP_TICKETS_STREAM_NAME` and
|
||||||
|
`ZULIP_COMMITS_STREAM_NAME`.
|
||||||
|
|
||||||
|
1. Go to your Codebase settings, and click on **My Profile**. Under
|
||||||
|
**API Credentials**, you will find your API key and username.
|
||||||
|
Edit the following lines in `zulip_codebase_config.py` to add your Codebase
|
||||||
|
credentials:
|
||||||
|
|
||||||
```
|
```
|
||||||
CODEBASE_API_USERNAME = "zulip-inc/leo-franchi-15"
|
CODEBASE_API_USERNAME = "zulip-inc/leo-franchi-15"
|
||||||
CODEBASE_API_KEY = 0123456789abcdef0123456789abcdef
|
CODEBASE_API_KEY = 0123456789abcdef0123456789abcdef
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Before your first run of the script, you may optionally choose to configure it
|
Before your first run of the script, you may also want to configure the
|
||||||
to mirror some number of hours of prior Codebase activity:
|
integration to mirror some number of hours of prior Codebase activity:
|
||||||
|
|
||||||
```
|
```
|
||||||
CODEBASE_INITIAL_HISTORY_HOURS = 10
|
CODEBASE_INITIAL_HISTORY_HOURS = 10
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Now, simply run the `api/integrations/codebase/zulip_codebase_mirror` script.
|
1. Run the `/usr/local/share/zulip/integrations/codebase/zulip_codebase_mirror`
|
||||||
If needed, this script may be restarted, and it will automatically resume from
|
script. If needed, this script may be restarted, and it will automatically
|
||||||
when it was last running.
|
resume from when it was last running.
|
||||||
|
|
||||||
8. Whenever you create a new project, commit, issue, deployment, or more, you’ll
|
|
||||||
get notifications in your selected streams with the associated information.
|
|
||||||
|
|
||||||
{!congrats.md!}
|
{!congrats.md!}
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
{!download-python-bindings.md!}
|
Get Zulip notifications for your Git repositories!
|
||||||
|
|
||||||
{!create-stream.md!}
|
1. {!create-a-bot-indented.md!}
|
||||||
|
|
||||||
{!change-zulip-config-file.md!}
|
1. {!download-python-bindings.md!}
|
||||||
|
|
||||||
You can also specify which pushes will result in notifications and to
|
1. {!create-stream.md!}
|
||||||
what stream the notifications will be sent by modifying the
|
|
||||||
`commit_notice_destination` function in `zulip_git_config.py`. By
|
|
||||||
default, pushes to the `master` and `test-post-receive` branches will
|
|
||||||
result in a notification to the stream `commits`.
|
|
||||||
|
|
||||||
Save `integrations/git/zulip_git_config.py` to the `.git/hooks`
|
1. {!change-zulip-config-file-indented.md!}
|
||||||
directory of your git repository.
|
|
||||||
|
|
||||||
Symlink `/usr/local/share/zulip/integrations/git/post-receive` to
|
You may also need to change the value of `STREAM_NAME`.
|
||||||
the `.git/hooks` directory of your git repository.
|
|
||||||
|
|
||||||
Whenever you make a push to the `master` branch of your git repository
|
You can specify the branches that will be used for notifications by modifying
|
||||||
(or whatever you configured above), the Zulip git plugin will send an
|
the `commit_notice_destination` function. By default,
|
||||||
automated notification.
|
pushes to the `master` and `test-post-receive` branches will result in a
|
||||||
|
notification.
|
||||||
|
|
||||||
|
1. Symlink `/usr/local/share/zulip/integrations/git/zulip_git_config.py`
|
||||||
|
to the `.git/hooks` directory of your git repository.
|
||||||
|
|
||||||
|
1. Symlink `/usr/local/share/zulip/integrations/git/post-receive`
|
||||||
|
to the `.git/hooks` directory of your git repository.
|
||||||
|
|
||||||
|
!!! tip ""
|
||||||
|
|
||||||
|
You can test the plugin without changing your `master` branch by
|
||||||
|
pushing to the `test-post-receive` branch.
|
||||||
|
|
||||||
{!congrats.md!}
|
{!congrats.md!}
|
||||||
|
|
||||||
![](/static/images/integrations/git/001.png)
|
![](/static/images/integrations/git/001.png)
|
||||||
|
|
||||||
**Testing**
|
|
||||||
|
|
||||||
You can test the plugin without changing your `master` branch by
|
|
||||||
pushing to the `test-post-receive` branch.
|
|
||||||
|
|
|
@ -383,7 +383,8 @@ INTEGRATIONS = {
|
||||||
doc='zerver/integrations/email.md'),
|
doc='zerver/integrations/email.md'),
|
||||||
'errbot': Integration('errbot', 'errbot', ['meta-integration', 'bots'],
|
'errbot': Integration('errbot', 'errbot', ['meta-integration', 'bots'],
|
||||||
doc='zerver/integrations/errbot.md'),
|
doc='zerver/integrations/errbot.md'),
|
||||||
'git': Integration('git', 'git', ['version-control'], doc='zerver/integrations/git.md'),
|
'git': Integration('git', 'git', ['version-control'],
|
||||||
|
stream_name='commits', doc='zerver/integrations/git.md'),
|
||||||
'google-calendar': Integration(
|
'google-calendar': Integration(
|
||||||
'google-calendar',
|
'google-calendar',
|
||||||
'google-calendar',
|
'google-calendar',
|
||||||
|
|
Loading…
Reference in New Issue