integrations doc: Move mercurial doc to separate file.

This commit is contained in:
Tomasz Kolek 2017-04-05 07:35:34 +02:00 committed by Tim Abbott
parent 372c7224f0
commit 489a7d1784
4 changed files with 113 additions and 104 deletions

View File

@ -116,109 +116,6 @@
{% include 'zerver/integrations/email.html' %}
{% endif %}
<div id="mercurial" class="integration-instructions">
<p>Get Zulip notifications when you <code>hg push</code>!</p>
<p>First, create the stream you'd like to use for Mercurial notifications,
and subscribe all interested parties to this stream. We recommend the
name <code>commits</code>.</p>
<p>Next, on your {{ settings_html|safe }}, create a Mercurial bot.</p>
<p>Then:</p>
<ol>
<li>
<p>Download and install our <a href="/api">Python bindings</a> on the
server where the master Mercurial repository lives.</p>
</li>
<li>
<p>Edit the <code>hg/.hgrc</code> configuration file for this master
Mercurial repository and add the following sections, using the
credentials for your Mercurial bot and setting the appropriate path to
the integration hook if it installs in a different location on this
system:</p>
<pre>[hooks]
changegroup = python:/usr/local/share/zulip/integrations/hg/zulip-changegroup.py:hook
[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"
{% if api_site_required %}site = {{ external_api_uri_subdomain }}{% endif %}</pre>
</li>
</ol>
<p>That's all it takes for the basic setup! On the next
<code>hg push</code>, you'll get a Zulip update for the changeset.</p>
<h3>More configuration options</h3>
<p>The Mercurial integration also supports:</p>
<ul>
<li>linking to changelog and revision URLs for your repository's web
UI</li>
<li>branch whitelists and blacklists</li>
</ul>
<h4>Web repository links</h4>
<p>If you've set up your repository to
be <a href="http://mercurial.selenic.com/wiki/QuickStart#Network_support">browsable
via the web</a>, add a <code>web_url</code> configuration option to
the <code>zulip</code> section of your master <code>.hg/hgrc</code> to get
changelog and revision links in your Zulip notifications:</p>
<pre><font color="#B6B6B4">[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"</font>
web_url = "http://hg.example.com:8000/"
{% if api_site_required %}site = {{ external_api_uri_subdomain }}{% endif %}</pre>
<h4>Branch whitelists and blacklists</h4>
<p>By default, this integration will send Zulip notifications for
changegroup events for all branches. If you'd prefer to only receive Zulip
notifications for specified branches, add a <code>branches</code>
configuration option to the <code>zulip</code> section of your
master <code>.hg/hgrc</code>, containing a comma-separated list of the
branches that should produce notifications:</p>
<pre><font color="#B6B6B4">[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"</font>
branches = "prod,master"</pre>
<p>You can also exclude branches that you don't want to cause
notifications. To do so, add an <code>ignore_branches</code> configuration
option to the <code>zulip</code> section of your
master <code>.hg/hgrc</code>, containing a comma-separated list of the
branches that should be ignored:</p>
<pre><font color="#B6B6B4">[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"</font>
ignore_branches = "noisy,even-more-noisy"</pre>
<p><b>Congratulations! You're done!</b><br /> When team members push new
changesets with <code>hg push</code>, you'll get a Zulip notification that
looks like this:</p>
<img class="screenshot" src="/static/images/integrations/hg/001.png" />
<p style="font-size:11px; font-style:italic;">
Logos are trademarks of their respective owners.
None of the integrations on this page are created by,
affiliated with, or supported by the companies
represented by the logos.
</p>
</div>
<div id="nagios" class="integration-instructions">

View File

@ -0,0 +1,105 @@
<p>Get Zulip notifications when you <code>hg push</code>!</p>
<p>
First, create the stream you'd like to use for Mercurial notifications,
and subscribe all interested parties to this stream. We recommend the
name <code>commits</code>.
</p>
<p>Next, on your {{ settings_html|safe }}, create a Mercurial bot.</p>
<p>Then:</p>
<ol>
<li>
<p>Download and install our <a href="/api">Python bindings</a> on the
server where the master Mercurial repository lives.</p>
</li>
<li>
<p>
Edit the <code>hg/.hgrc</code> configuration file for this master
Mercurial repository and add the following sections, using the
credentials for your Mercurial bot and setting the appropriate path to
the integration hook if it installs in a different location on this
system:
</p>
<pre>[hooks]
changegroup = python:/usr/local/share/zulip/integrations/hg/zulip-changegroup.py:hook
[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"
{% if api_site_required %}site = {{ external_api_uri_subdomain }}{% endif %}</pre>
</li>
</ol>
<p>
That's all it takes for the basic setup! On the next
<code>hg push</code>, you'll get a Zulip update for the changeset.
</p>
<h3>More configuration options</h3>
<p>The Mercurial integration also supports:</p>
<ul>
<li>linking to changelog and revision URLs for your repository's web
UI
</li>
<li>branch whitelists and blacklists</li>
</ul>
<h4>Web repository links</h4>
<p>
If you've set up your repository to be
<a href="http://mercurial.selenic.com/wiki/QuickStart#Network_support">browsable via the web</a>,
add a <code>web_url</code> configuration option to
the <code>zulip</code> section of your master <code>.hg/hgrc</code> to get
changelog and revision links in your Zulip notifications:
</p>
<pre><font color="#B6B6B4">[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"</font>
web_url = "http://hg.example.com:8000/"
{% if api_site_required %}site = {{ external_api_uri_subdomain }}{% endif %}</pre>
<h4>Branch whitelists and blacklists</h4>
<p>
By default, this integration will send Zulip notifications for
changegroup events for all branches. If you'd prefer to only receive Zulip
notifications for specified branches, add a <code>branches</code>
configuration option to the <code>zulip</code> section of your
master <code>.hg/hgrc</code>, containing a comma-separated list of the
branches that should produce notifications:
</p>
<pre><font color="#B6B6B4">[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"</font>
branches = "prod,master"</pre>
<p>You can also exclude branches that you don't want to cause
notifications. To do so, add an <code>ignore_branches</code> configuration
option to the <code>zulip</code> section of your
master <code>.hg/hgrc</code>, containing a comma-separated list of the
branches that should be ignored:</p>
<pre><font color="#B6B6B4">[zulip]
email = "hg-bot@example.com"
api_key = "0123456789abcdefg"
stream = "commits"</font>
ignore_branches = "noisy,even-more-noisy"</pre>
<p>
<b>Congratulations! You're done!</b><br/> When team members push new
changesets with <code>hg push</code>, you'll get a Zulip notification that
looks like this:
</p>
<img class="screenshot" src="/static/images/integrations/hg/001.png"/>

View File

@ -130,6 +130,7 @@ def check_html_templates(templates, all_dups):
'templates/zerver/integrations/capistrano.html',
'templates/zerver/integrations/git.html',
'templates/zerver/integrations/jira-plugin.html',
'templates/zerver/integrations/mercurial.html',
]
validate(fn=fn, check_indent=(fn not in bad_files))
@ -188,6 +189,7 @@ def check_html_templates(templates, all_dups):
'templates/zerver/integrations/git.html',
'templates/zerver/integrations/google-calendar.html',
'templates/zerver/integrations/jira-plugin.html',
'templates/zerver/integrations/mercurial.html',
]
# TODO: Clean these files
for fn in templates:

View File

@ -209,7 +209,12 @@ INTEGRATIONS = {
display_name='JIRA',
doc='zerver/integrations/jira-plugin.html'
),
'mercurial': Integration('mercurial', 'mercurial', display_name='Mercurial (hg)'),
'mercurial': Integration(
'mercurial',
'mercurial',
display_name='Mercurial (hg)',
doc='zerver/integrations/mercurial.html'
),
'nagios': Integration('nagios', 'nagios'),
'openshift': Integration('openshift', 'openshift', display_name='OpenShift'),
'perforce': Integration('perforce', 'perforce'),