diff --git a/templates/zerver/integrations/capistrano.html b/templates/zerver/integrations/capistrano.html deleted file mode 100644 index afebb77a51..0000000000 --- a/templates/zerver/integrations/capistrano.html +++ /dev/null @@ -1,54 +0,0 @@ -
- First, download and install our Python
- bindings and example scripts on your Capistrano server.
- 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: -
-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:
---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.
- deploy
above to
- another step of your deployment process, if you'd like the
- notification to fire at a different time.
-
- Congratulations! You're done!
Whenever you do a
- deployment, you'll get an automated notification that looks like
- this:
-
- Thanks to Wes of TurboVote for submitting this - integration! - -
diff --git a/templates/zerver/integrations/capistrano.md b/templates/zerver/integrations/capistrano.md new file mode 100644 index 0000000000..0642fe5051 --- /dev/null +++ b/templates/zerver/integrations/capistrano.md @@ -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)! diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py index 44b4197926..2e0c8522dc 100644 --- a/zerver/lib/integrations.py +++ b/zerver/lib/integrations.py @@ -215,7 +215,7 @@ WEBHOOK_INTEGRATIONS = [ INTEGRATIONS = { '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'), 'email': EmailIntegration('email', 'email', doc='zerver/integrations/email.html'), 'git': Integration('git', 'git', doc='zerver/integrations/git.html'),