jobber icon indicating copy to clipboard operation
jobber copied to clipboard

Add result sinks for Telegram, Slack, Email

Open zelenin opened this issue 7 years ago • 8 comments

Make notification sender (jobbern) with some default providers (email, telegram, slack, webhook etc).

Configuration example:

[prefs]
  notifyProgram: jobbern

[notifications]
- my_email:
  provider: 'email'
  params:
    email: '[email protected]'

- my_telegram:
  provider: 'telegram'
  params:
    chat_id: '123456789'
    token: 'abcdef123456'

- common_telegram:
  provider: 'telegram'

[jobs]
- name: "job#1"
  ...
  notification:
    - via: 'my_email'
    - via: 'my_telegram'
    - via: 'common_telegram'
      params:
        chat_id: '098765'
        token: 'abcdef123456'

zelenin avatar Jan 15 '18 08:01 zelenin

How do you feel about using YAML anchors/references? Like this:

[notifySinks]
my_email: &my_email
    provider: 'email'
    params:
        email: '[email protected]'

my_telegram_1: &my_telegram_1
    provider: 'telegram'
    params:
      chat_id: '123456789'
      token: 'abcdef123456'

my_telegram_2: &my_telegram_2
    provider: 'telegram'
    params:
      chat_id: '987654'
      token: 'abcdef987654'

[jobs]
- name: 'job#1'
  ...
  notifyOnError:
      - *my_email
      - *my_telegram_1
  notifyOnSuccess:
      - *my_email
      - *my_telegram_2

I'd like to drop the ability to override notify provider params in the job def, in order to reduce complexity.

dshearer avatar Mar 11 '18 00:03 dshearer

I agree with it. It's clear.

zelenin avatar Mar 11 '18 03:03 zelenin

Actually, I'm thinking of merging #179 into this. We have a notion of "result sink", which is given the result of a run (success/failure), stdout, and stderr, and then does something with it.

(At the same time, I'm thinking of just making the whole jobfile pure YAML.)

See https://github.com/dshearer/jobber/wiki/1.4-Jobfile-Format

dshearer avatar Mar 11 '18 19:03 dshearer

Hi @dshearer,

from this discussion, it's not really clear if this is only change of a configuration file, to allow multiple notifications providers or an actual implementation of those providers for defined types e.g. email or telegram.

I'm thinking about replacing cron with jobber, but I'm not sure if I should spend time now on writing own notification program if it will be provided soon.

Thanks!

s7anley avatar Mar 19 '18 15:03 s7anley

Yes, this ticket is for providing these implementations. I do plan to do this, but I don't know by when.

dshearer avatar Mar 21 '18 00:03 dshearer

I will write simple notifier, for now then. Thanks for the update.

s7anley avatar Mar 22 '18 06:03 s7anley

Plugins could be nice. Maybe reuse plugins from drone.io http://readme.drone.io/plugins/plugin-overview/

techtonik avatar May 04 '18 02:05 techtonik

How do you feel about using YAML anchors/references?

I feel bad about them. Unless you know what are YAML anchors, the format looks too cryptic.

techtonik avatar May 04 '18 02:05 techtonik