integrations/openshift: Use Markdown macros.

This commit is contained in:
Eeshan Garg
2017-06-21 16:18:34 -02:30
committed by showell
parent 1d9ab996c7
commit b9ac92c1a0
2 changed files with 10 additions and 33 deletions

View File

@@ -1,40 +1,22 @@
Ths integration sends a notification every time a deployment is made This integration sends a notification every time a deployment is made
in an OpenShift instance. in an OpenShift instance.
{! download-python-bindings.md !} Move it to your local copy of the {!create-stream.md!}
applications repository.
{!download-python-bindings.md!}
Then, create a new commit including all the changes made to the Then, create a new commit including all the changes made to the
repository, and push it to your app. repository, and push it to your app.
After that, connect to the application through SSH. If you dont know After that, connect to the application through SSH. If you dont know
how to do this, log in to your OpenShift Online account, go to your how to do this, log in to your OpenShift Online account, go to your
applications dashboard, and click Want to log in to your applications dashboard, and click **Want to log in to your
application?. There youll find the apps SSH user, address, and application?**. There youll find the apps SSH user, address, and
further information on SSH, in case you need it. further information on SSH, in case you need it.
![](/static/images/integrations/openshift/002.png) ![](/static/images/integrations/openshift/002.png)
Once you have connected, install the Python bindings by running: {!change-zulip-config-file.md!}
```bash
$ cd ~/app-root/repo/<python_bindings_path>
$ python setup.py install
```
Where `<python_bindings_path>` is the path where you saved the
bindings in the first step.
Next, open `integrations/openshift/zulip_openshift_config.py` inside
the SSH terminal with your favorite editor, and change the following
lines to specify the email address and API key for your OpenShift
integration:
```
ZULIP_USER = "openshift-bot@example.com"
ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
{% if api_site_required %}ZULIP_SITE = "{{ external_api_uri_subdomain }}"{% endif %}
```
You can also specify which pushes will result in notifications and to You can also specify which pushes will result in notifications and to
what stream the notifications will be sent by modifying the what stream the notifications will be sent by modifying the
@@ -47,18 +29,12 @@ Save the file, and symlink
`$OPENSHIFT_PYTHON_DIR/virtenv/share/zulip/integrations/openshift/post-receive` `$OPENSHIFT_PYTHON_DIR/virtenv/share/zulip/integrations/openshift/post-receive`
into the `~/app-root/repo/.openshift/action_hooks` directory. into the `~/app-root/repo/.openshift/action_hooks` directory.
Next, create the stream youd like to use for OpenShift notifications,
and subscribe all interested parties to this stream. The integration
will use the default stream `deployments` if no stream is supplied in
the hook; you still need to create the stream even if you are using
this default.
Whenever you make a push to the `master` branch of your applications Whenever you make a push to the `master` branch of your applications
repository (or whichever branch you configured above), or if you force repository (or whichever branch you configured above), or if you force
a deployment, the Zulip OpenShift plugin will send an automated a deployment, the Zulip OpenShift plugin will send an automated
notification. notification.
{! congrats.md !} {!congrats.md!}
![](/static/images/integrations/openshift/001.png) ![](/static/images/integrations/openshift/001.png)

View File

@@ -287,7 +287,8 @@ INTEGRATIONS = {
'openshift', 'openshift',
'openshift', 'openshift',
display_name='OpenShift', display_name='OpenShift',
doc='zerver/integrations/openshift.md' doc='zerver/integrations/openshift.md',
stream_name='deployments',
), ),
'perforce': Integration('perforce', 'perforce', doc='zerver/integrations/perforce.html'), 'perforce': Integration('perforce', 'perforce', doc='zerver/integrations/perforce.html'),
'phabricator': Integration('phabricator', 'phabricator', doc='zerver/integrations/phabricator.md'), 'phabricator': Integration('phabricator', 'phabricator', doc='zerver/integrations/phabricator.md'),