Skip to content

tamanyan/digdag-hangouts-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

digdag-hangouts-chat

Description

digdag-hangouts-chat is a plugin sending messages to Hangouts Chat. It can customize json templates for building messages.

DEMO:

SUCCESS FAILED
success.jpg sample-danger.png

Features

  • Can use the hangouts> opetaror
  • Easy to use
  • Flexible templates

Requirement

Usage

Also, you can see expamle workflow at sample directory.

  1. Create workflow file (e.g. hangouts.dig)
_export:
  plugin:
    repositories:
      - https://jitpack.io
      # - file://${repos}
    dependencies:
      - com.github.tamanyan:digdag-hangouts-chat:0.1.5
      # - io.digdag.plugin:digdag-hangouts-chat:0.1.5
  # Set Reqired params
  webhook_url: https://chat.googleapis.com/v1/spaces/XXXXXXXXXXXXXXX/messages?key=XXXXXXXXXXXXX
  # Set Option params
  workflow_name: Hangouts Workflow
  ENV: develop

+step1-1:
  echo>: "Next will be success!"

+step1-2:
  hangouts>: success_template.json

+step2-1:
  echo>: "Next will be failed..."

+step2-2:
  sh>: exit 1
  _error:
    hangouts>: failed_template.json
  1. Create templates for Hangouts Message (e.g. success_template.json)
{
  "cards": [
    {
      "sections": [
        {
          "widgets": [
            {
              "keyValue": {
                "topLabel": "Workflow Name",
                "content": "${workflow_name}",
                "contentMultiline": "false"
              }
            },
            {
              "keyValue": {
                "topLabel": "Task Name",
                "content": "${task_name}"
              }
            },
            {
              "keyValue": {
                "topLabel": "Message",
                "content": "Workflow executed successfully",
                "contentMultiline": "true"
              }
            }
          ]
        }
      ]
    }
  ]
}
  1. Runs workflow
$ digdag run -a hangouts.dig

Customize Messages

You can see documentations about Hangout Card formatting Message if you are interested in customizing messages.

Card Formatting Messages

Author

Taketo Yoshida

License

Apache License 2.0

About

digdag-hangouts-chat is a plugin sending messages to Hangouts Chat https://www.digdag.io/

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages