Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Unknown task type: slack (config) #21

Closed
giiita opened this issue Jun 7, 2018 · 2 comments
Closed

error: Unknown task type: slack (config) #21

giiita opened this issue Jun 7, 2018 · 2 comments

Comments

@giiita
Copy link

giiita commented Jun 7, 2018

slack.dig

_export:
  plugin:
    repositories:
      - https://jitpack.io
    dependencies:
      - com.github.szyn:digdag-slack:0.1.2
  webhook_url: https://hooks.slack.com/services/X/X/X
  ENV: develop

template.yml

---
username: digdag
channel: "XXX"
icon_url: https://XXX
attachments:
- fallback: '[FAILED] ${env_name} ${task_name}'
  color: "danger"
  text: '*[FAILED]* ${env_name} `${task_name}`'
  mrkdwn_in:
  - text
  - pretext
  - fields
  fields:
  - title: Error Message
    value: "`${error.message}`"
    short: false
  - title: Error Stacktrace
    value: "```${error.stacktrace}```"
    short: false
  - title: Session Local Time
    value: "${session_local_time}"
    short: true
  - title: Env
    value: "${env_name}"
    short: true

execute.yml

timezone: Asia/Tokyo

!include : 'slack.dig'

# schedule:
#  cron>: 0 */2 * * *

_export:
  target: XXX


+create-job:
  sh>: "curl -s ${target} | run -"

+check-job:
  sh>: "./check-job.sh - ${target}"
  _error:
    sh>: "curl -s ${target} | drop -"

+delete-job:
  sh>: "curl -s ${target} | drop -"

_error:
  slack>: template.yml

But was,,,

2018-05-20 10:30:02.292 +0000 [INFO] (416979@[0:]+execute^error) io.digdag.core.agent.OperatorManager: slack>: template.yml
2018-05-20 10:30:02.292 +0000 [ERROR] (416979@[0:]+execute^error) io.digdag.core.agent.OperatorManager: Configuration error at task +execute^error: Unknown task type: slack (config)
@szyn
Copy link
Owner

szyn commented Jun 7, 2018

Hi, @giiita. Thank you for reporting this issue.

It looks like have a problem with the workflow definition.
If you want to write plugins settings as the other file, you have to read those params from _export.

For example:

1. Create a file for params

Write params to use the plugin...etc. (such as common parameters in this project)

params.dig

plugin:
repositories:
    - https://jitpack.io
dependencies:
    - com.github.szyn:digdag-slack:0.1.2
webhook_url: https://hooks.slack.com/services/X/X/X
ENV: develop

NOTE: _export: is not necessary.

2. Create a template for notification

template.yml (no changes)

---
username: digdag
channel: "XXX"
icon_url: https://XXX
attachments:
- fallback: '[FAILED] ${env_name} ${task_name}'
color: "danger"
text: '*[FAILED]* ${env_name} `${task_name}`'
mrkdwn_in:
- text
- pretext
- fields
fields:
- title: Error Message
    value: "`${error.message}`"
    short: false
- title: Error Stacktrace
    value: "```${error.stacktrace}```"
    short: false
- title: Session Local Time
    value: "${session_local_time}"
    short: true
- title: Env
    value: "${env_name}"
    short: true

3. Some make changes workflow file

execute.dig

timezone: Asia/Tokyo

_export:
!include : params.dig  # **IMPORTANT** load params from another file
target: XXX

+create-job:
sh>: "curl -s ${target} | run -"

+check-job:
sh>: "./check-job.sh - ${target}"
_error:
    sh>: "curl -s ${target} | drop -"

+delete-job:
sh>: "curl -s ${target} | drop -"

_error:
slack>: template.yml

Then, everything will be OK.
If you let me know when you get another error.

@giiita
Copy link
Author

giiita commented Jun 8, 2018

Thanks.

@giiita giiita closed this as completed Jun 8, 2018
@giiita giiita reopened this Jun 8, 2018
@giiita giiita closed this as completed Jun 8, 2018
@giiita giiita reopened this Jun 8, 2018
@giiita giiita closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants