Chatops With Slack
Fork me on GitHub

All Tags:

mindset

devops

book

ci

communication

jenkins

自媒体

hometown

tools

tool

cloud

 22 November 2017

Chatops With Slack

by

ChatOps With Slack and Mattermost

Subscribe to an RSS feed URL and receive updates in Slack

Automate Task

自助问答

定时任务

https://github.com/attzonko/mmpy_bot/blob/main/mmpy_bot/plugins/example.py

Mattermost

Install Mattermost in Ubuntu WSL


sudo -u mattermost ./bin/mattermost

Jenkins Integration

通过mattermost 直接触发Jenkins的Job

CR Approve

通过restapi 来check 并 approve 对应的CR

Mattermost WebHook

GitHub Action to send PR notification to Mattermost

add a file notify.yml under .github/workflows/notify.yml


# on:
#   # Triggers the workflow on push or pull request events but only for the master branch
#   push:
#     branches: [ master ]
#   pull_request:
#     branches: [ master ]

# jobs:
#   build:
#     runs-on: self-hosted

#     steps:
#     - uses: actions/checkout@v1
#     - name: Create the Mattermost Message for Push Event
#       if: $
#       run: |
#         echo "{ \"username\": \"Chido\", \"text\":\"Push on [$]($) by $.See [commit list]($) \"}" > mattermost.json
#     - name: Create the Mattermost Message for Pull Request Event
#       if: $
#       run: |
#         echo "{ \"username\": \"Chido\", \"text\":\"$ pull request [$]($) by $.See [commit list]($)\n**Source** : $\n**Destination** : $ \"}" > mattermost.json
#     - uses: actions/action-mattermost-notify@1.1.0
#       env:
#         MATTERMOST_WEBHOOK_URL: $
#         MATTERMOST_CHANNEL: $

Reference

https://docs.mattermost.com/deployment/bots.html

https://forum.mattermost.org/

https://mmpy-bot.readthedocs.io/en/latest/plugins.html

tags: