digdag-slack
Description
digdag-slack is a plugin sending messages to slack.
It can use yaml templates for building messages.
DEMO:
SUCCESS | FAILED |
---|---|
Features
- Can use the
slack>
opetaror - Easy to use
- Flexible templates
Requirement
[Note]
If you want to use task_name
variable, you must use digdag v0.9.9 and up.
Usage
Also, you can see expamle workflow at sample directory.
- Create workflow file (e.g. slack.dig)
_export:
plugin:
repositories:
- https://jitpack.io
dependencies:
- com.github.szyn:digdag-slack:0.1.1
# Set Reqired params
webhook_url: https://hooks.slack.com/services/XXX/XXX/XXX
# Set Option params
workflow_name: slack
ENV: develop
+step1-1:
echo>: "Next will be success!"
+step1-2:
slack>: good-template.yml
- Create templates for slack's payload (e.g. good-template.yml)
---
username: Digdag
icon_emoji: ':blush:'
attachments:
- fallback: '[SUCCESS] ${workflow_name} workflow'
color: "good"
text: '*[SUCCESS]* `${workflow_name}` Workflow'
mrkdwn_in:
- text
- pretext
- fields
fields:
- title: Task Name
value: "${task_name}"
short: false
- title: Session Date
value: "${session_date}"
short: true
- title: Environment
value: "${ENV}" # You can use environment values
short: true
- Runs workflow
$ digdag run -a slack.dig