Zulip Integration¶
Zulip is a team chat tool, in context of DevOps it can be used for sending various events of intenrest. Some of these event include:
Generate Trello Application Key and User Token
Running of a cron job {or in case of Django a Management Command}
Notify ops team when someone logs onto server
Notify development team when customer files a bug on issues tracking sytem {E.g. Trello}
Trello¶
Trello is a good productivity that gets all stake holder on to a single platform. Following notes suggests how to integrate Trello with Zulip
Obtain Trello’s Keys, you need to obtain
Board ID: Go to your Trello board. The URL should look like
https://trello.com/b/<BOARD_ID>/<BOARD_NAME>.
Note down the <BOARD_ID>
API Key: Go to
https://trello.com/1/appkey/generate
Note down the key listed under Developer API Keys.
User Token: Go to
https://trello.com/1/appkey/generate
Under Developer API Keys, click on the Token link. Click on Allow. Note down the token generated.
Once this is done, you need to
Create the stream on Zulip where you’d like to use for Trello notifications
Create topic in that stream
Construct the URL for integration using the bot’s API key and the desired stream name
https://XXX.zulipchat.com/api/v1/external/trello?api_key=XXXXXXX&stream=<STREAM_NAME>&topic=<TOPIC_NAME>
Create zulip_trello_config.py file with following contents
TRELLO_API_KEY = "XXX"
TRELLO_TOKEN = "XXXXXXXXX"
ZULIP_WEBHOOK_URL = "https://XXX.zulipchat.com/api/v1/external/trello?api_key=XXXXXXX&stream=<STREAM_NAME>&topic=<TOPIC_NAME>"
Download and run zulip_trello.py
python zulip_trello.py --trello-board-name <trello_board_name> --trello-board-id <trello_board_id>
CLI integration¶
Lets say you want to send messages from command lines {e.g. via Python app}, following are the steps to do it
Install zulip client package
pip install zulip
Get Zuplip keys by following these instructions
Create ~/.zuliprc file and use following configuration
[api]
email=<your_email_address@domain.com>
key=<your_zulip_api_key>
site=<https://your_zulip_domain.zulipchat.com>
Check if you’re able to send messages using zulip-send command
zulip-send --stream YourStream --subject YourSubject --message "This is awesome message from zulip" --config-file ~/.zuliprc
Sending message to specific user can be achieved using
zulip-send users_email@domain.com --message "This is awesome message from zulip" --config-file ~/.zuliprc