grimrose / digdag-slack

digdag-slack is a plugin sending messages to slack :tada: https://www.digdag.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

digdag-slack

Description

digdag-slack is a plugin sending messages to slack.
It can use yaml templates for building messages.

DEMO:

SUCCESS FAILED
sample-good.png sample-danger.png

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.

  1. 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
  1. 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
  1. Runs workflow
$ digdag run -a slack.dig

Author

szyn

License

Apache License 2.0

About

digdag-slack is a plugin sending messages to slack :tada: https://www.digdag.io/

License:Apache License 2.0


Languages

Language:Java 100.0%