https://github.com/attzonko/mmpy_bot/blob/main/mmpy_bot/plugins/example.py
sudo -u mattermost ./bin/mattermost
通过mattermost 直接触发Jenkins的Job
通过restapi 来check 并 approve 对应的CR
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: $
https://docs.mattermost.com/deployment/bots.html
https://forum.mattermost.org/
https://mmpy-bot.readthedocs.io/en/latest/plugins.html