A simple reporter for horenso with Python
Download horenso by Songmu [GitHub]
$ go get github.com/Songmu/horenso/cmd/horenso
$ git clone https://github.com/hirokazutei/python-horenso-reporter-slack.git
$ export SLACK_TOKEN="<SLACK TOKEN>"
$ export SLACK_CHANNEL="<SLACK CHANNEL>"
$ export SLACK_SUCCESS_EMOJI="<SLACK EMOJI>"
$ export SLACK_ERROR_EMOJI="<SLACK EMOJI>"
$ export SLACK_MAJOR_ERROR_EMOJI="<SLACK EMOJI>"
$ export SLACK_NOTIFICATION_MUTE_LEVEL="<0 ~ 2>"
$ export SLACK_REPORT_ITEMS=['ITEMS','TO','REPORT']
$ export SLACK_FORMAT_ERROR=False
- Required, can be found on the Slack API page.
- The name of the channel you would like to send the message to.
- Default is #general
- The icon used when the command runs without any errors.
- Default is ✅
- The icon used when the command encounters an exit code of 1.
- Default is
⚠️
- The icon used when the command encounters an exit code of 2 or others.
- Default is ⛔
- A value between 0 and 2 inclusive.
- 0 displays all messages.
- 1 ignores commands successfully ran.
- 2 ignores commands successfully ran and regular errors.
- List of strings representing the items that one wishes to report
- Default is:
['stdout', 'stderr', 'startAt', 'endAt']
exitCode
andcommand
are reported as default. Change that in the code if you wish- Other Items:
'systemTime'
'commandArgs'
'userTime'
'hostname'
'pid'
'signaled'
'result'
'output'
- Other Items:
- This is just to show if there were any errors in fornatting the outputs or time.
- Everything should still work even if errors occur during formatting.
- Default is set to
False
.
$ horenso -r "python DIR/slack_reporter.py" -- <COMMAND>
Note: If you are using python3, you will need install dateutil
- Mentions
- Proper bot support
- Pastebin/Fluend support
- Please suggest more