digdag-slack is a plugin sending messages to slack. It can use yaml templates for building messages.
DEMO:
SUCCESS | FAILED |
---|---|
- Can use the
slack>
opetaror - Easy to use
- Flexible templates
- Digdag
- Slack
- Webhook URL (Incoming WebHooks)
[Note]
If you want to use ${task_name}
, you must digdag v0.9.9 and up.
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.4
# 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:'
# channel: '#general' ## if you need to send message to specific channel
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 exported environment values
short: true
- Runs workflow
$ digdag run -a slack.dig
-
slack.webhook_url: The slack incoming webhook url
_export: ... # Set Reqired params webhook_url: ${secret:slack.webhook_url}