Migrate capistrano.html to markdown.

This commit is contained in:
Aditya Bansal 2017-06-05 20:45:20 +05:30 committed by Tim Abbott
parent 84bbed6c49
commit 6b86de3a3c
3 changed files with 34 additions and 55 deletions

View File

@ -1,54 +0,0 @@
<p>
First, download and install our <a href="/api">Python
bindings and example scripts</a> on your Capistrano server.
Once you've done that, you'll use the <code>zulip-send</code>
utility to notify you when certain events happen.
</p>
<p>
Here's some example code for sending a Zulip notification
after a deployment has completed:
</p>
<div class="codehilite"><pre><span class="n">after</span> <span class="s1">'deploy'</span><span class="p">,</span> <span
class="s1">'notify:humbug'</span>
<span class="n">namespace</span> <span class="ss">:notify</span> <span class="k">do</span>
<span class="n">desc</span> <span class="s2">"Post a message to Zulip that we've deployed"</span>
<span class="n">task</span> <span class="ss">:humbug</span> <span class="k">do</span>
<span class="c1"># this will post to Zulip as the user defined in
# ~/.zuliprc if you omit --user and --api-key</span>
<span class="n">run_locally</span> <span class="s2">"echo ':beers: I just deployed to </span><span
class="si">#{</span><span class="n">stage</span><span class="si">}</span><span class="s2">! :beers:' | zulip-send \
--user capistrano-bot@example.com --api-key a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5 \
--site={{ external_api_uri_subdomain }} \
--stream commits --subject deployments || true"</span>
<span class="k">end</span>
<span class="k">end</span>
</pre>
</div>
<p>Some notes:</p>
<ul>
<li>If you prefer not to use <code>--user</code> and <code>--api-key</code> above, you can fill out
<code>~/.zuliprc</code> on your Capistrano
machine. For instructions on how to write that file, see <a href="/api">the API page</a>.
</li>
<li>You may need to change the <code>deploy</code> above to
another step of your deployment process, if you'd like the
notification to fire at a different time.
</li>
</ul>
<em></em>
<p>
<b>Congratulations! You're done!</b><br/> Whenever you do a
deployment, you'll get an automated notification that looks like
this:
</p>
<img class="screenshot" src="/static/images/integrations/capistrano/001.png"/>
<p>
<small>Thanks to Wes of TurboVote for <a href="https://gist.github.com/cap10morgan/5100822">submitting this
integration</a>!
</small>
</p>

View File

@ -0,0 +1,33 @@
{!download-python-bindings.md!}
Once you've done that, you'll use the `zulip-send` utility to notify you when certain events happen.
Here's some example code for sending a Zulip notification after a deployment has completed:
```bash
after 'deploy', 'notify:humbug'
namespace :notify do
desc "Post a message to Zulip that we've deployed"
task :humbug do
# this will post to Zulip as the user defined in
# ~/.zuliprc if you omit --user and --api-key
run_locally "echo ':beers: I just deployed to #{stage}! :beers:' | zulip-send \
--user capistrano-bot@example.com --api-key a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5 \
--site={{ external_api_uri_subdomain }} \
--stream commits --subject deployments || true"
end
end
```
Some notes:
* If you prefer not to use `--user` and `--api-key` above, you can fill out `~/.zuliprc` on your Capistrano
machine. For instructions on how to write that file, see [the API page](/api).
* You may need to change the `deploy` above to another step of your deployment process, if you'd like the
notification to fire at a different time.
{! congrats.md !}
![](/static/images/integrations/capistrano/001.png)
###### Thanks to Wes of TurboVote for [submitting this integration](https://gist.github.com/cap10morgan/5100822)!

View File

@ -215,7 +215,7 @@ WEBHOOK_INTEGRATIONS = [
INTEGRATIONS = { INTEGRATIONS = {
'asana': Integration('asana', 'asana', doc='zerver/integrations/asana.html'), 'asana': Integration('asana', 'asana', doc='zerver/integrations/asana.html'),
'capistrano': Integration('capistrano', 'capistrano', doc='zerver/integrations/capistrano.html'), 'capistrano': Integration('capistrano', 'capistrano', display_name='Capistrano', doc='zerver/integrations/capistrano.md'),
'codebase': Integration('codebase', 'codebase', doc='zerver/integrations/codebase.html'), 'codebase': Integration('codebase', 'codebase', doc='zerver/integrations/codebase.html'),
'email': EmailIntegration('email', 'email', doc='zerver/integrations/email.html'), 'email': EmailIntegration('email', 'email', doc='zerver/integrations/email.html'),
'git': Integration('git', 'git', doc='zerver/integrations/git.html'), 'git': Integration('git', 'git', doc='zerver/integrations/git.html'),