This tool is desired to post messages to a mattermost channel. You will need a mattermost webhook URL and give a channel name.
Python 3.7 and later is supported.
pip 19.0 or later is required.
You can install the latest stable release of mattermost-notify from the Python Package Index (pypi) using [pip]
python3 -m pip install --user mattermost-notify
Print a free text message:
mnotify-git <hook_url> <channel> --free "What a pitty!"
Print a github workflow status (legacy long/short templates):
mnotify-git <hook_url> <channel> -S [success, failure, warning] -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>
--notification-type is optional. Use it only when you want a specific template
(deployment, service-update, stage-transition, release, hotfix) and you
are passing deployment metadata.
Supported types:
deploymentservice-updatestage-transitionreleasehotfix
mnotify-git <hook_url> <channel> \
--notification-type deployment \
--product <product> \
--stage <stage> \
-S [success, failure, warning] \
-r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>
mnotify-git <hook_url> <channel> \
--notification-type service-update \
--service <service> \
--version <version> \
-S [success, failure, warning] \
-r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>
mnotify-git <hook_url> <channel> \
--notification-type stage-transition \
--product <product> \
--from-stage <from_stage> \
--to-stage <to_stage> \
-S [success, failure, warning] \
-r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>
mnotify-git <hook_url> <channel> \
--notification-type release \
--product <product> \
--version <version> \
-S [success, failure, warning] \
-r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>
mnotify-git <hook_url> <channel> \
--notification-type hotfix \
--product <product> \
--version <version> \
-S [success, failure, warning] \
-r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>
--product <name>
--stage <stage>
--version <version>
--service <service>
--from-stage <stage>
--to-stage <stage>
--notification-type <deployment|service-update|stage-transition|release|hotfix>
If no deployment metadata is provided, the tool falls back to the legacy long/short templates.
Copyright (C) 2021-2022 Jaspar Stach
Licensed under the GNU General Public License v3.0 or later.
