项目作者: tamanyan

项目描述 :
digdag-hangouts-chat is a plugin sending messages to Hangouts Chat https://www.digdag.io/
高级语言: Java
项目地址: git://github.com/tamanyan/digdag-hangouts-chat.git
创建时间: 2018-03-23T04:53:55Z
项目社区:https://github.com/tamanyan/digdag-hangouts-chat

开源协议:Apache License 2.0

下载


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)
  1. _export:
  2. plugin:
  3. repositories:
  4. - https://jitpack.io
  5. # - file://${repos}
  6. dependencies:
  7. - com.github.tamanyan:digdag-hangouts-chat:0.1.5
  8. # - io.digdag.plugin:digdag-hangouts-chat:0.1.5
  9. # Set Reqired params
  10. webhook_url: https://chat.googleapis.com/v1/spaces/XXXXXXXXXXXXXXX/messages?key=XXXXXXXXXXXXX
  11. # Set Option params
  12. workflow_name: Hangouts Workflow
  13. ENV: develop
  14. +step1-1:
  15. echo>: "Next will be success!"
  16. +step1-2:
  17. hangouts>: success_template.json
  18. +step2-1:
  19. echo>: "Next will be failed..."
  20. +step2-2:
  21. sh>: exit 1
  22. _error:
  23. hangouts>: failed_template.json
  1. Create templates for Hangouts Message (e.g. success_template.json)
  1. {
  2. "cards": [
  3. {
  4. "sections": [
  5. {
  6. "widgets": [
  7. {
  8. "keyValue": {
  9. "topLabel": "Workflow Name",
  10. "content": "${workflow_name}",
  11. "contentMultiline": "false"
  12. }
  13. },
  14. {
  15. "keyValue": {
  16. "topLabel": "Task Name",
  17. "content": "${task_name}"
  18. }
  19. },
  20. {
  21. "keyValue": {
  22. "topLabel": "Message",
  23. "content": "Workflow executed successfully",
  24. "contentMultiline": "true"
  25. }
  26. }
  27. ]
  28. }
  29. ]
  30. }
  31. ]
  32. }
  1. Runs workflow
  1. $ 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