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

notifyOnSuccess/Failure not supported as seq #322

Open
catalinmer opened this issue Dec 11, 2020 · 2 comments
Open

notifyOnSuccess/Failure not supported as seq #322

catalinmer opened this issue Dec 11, 2020 · 2 comments

Comments

@catalinmer
Copy link

Hi,
I have the following job definition:

[jobs]
- name: myjob
  cmd: |
    cp /a /b
    until [ $? -eq 0 ]; do
      echo "retry"
      sleep 1
      cp /a /b
    done
  time: '00 50 12 * * *'
  notifyOnSuccess:     
    - type: stdout     
      data:            
        - stdout       
        - stderr       
  notifyOnFailure:     
    - type: stdout
      data:     
        - stdout
        - stderr

but if i run jobber reload i get:

#jobber reload
Call to Jobber failed: Failed to parse "jobs" section: yaml: unmarshal errors:
  line 12: cannot unmarshal !!seq into bool
  line 17: cannot unmarshal !!seq into bool

i'm using latest version from docker container, 14.4
Would you be able to help me? thanks

@diasjorge
Copy link

The first part [jobs] is not valid yaml. It should be jobs:

@Pigpocket
Copy link

@diasjorge interestingly enough, that first line doesn't appear to be valid yaml, but it works. With this yaml file:

[jobs]
- name: ExampleScript
  cmd: /home/jobberuser/example-scheduled-task.sh
  time: '*'

My docker file runs my script every second. This is the example-scheduled-task.sh script:

#!/bin/sh
echo "The donkey is in charge"

The command jobber test ExampleScript returns:

~ $ jobber test ExampleScript
Running job "ExampleScript"...
Job "ExampleScript" succeeded.
New status: Good.

Stdout:
The donkey is in charge


Stderr:

So it seems [jobs] is, somehow, valid yaml. None of the configurations I've seen for actually capturing the output of that script , including those that include changing [jobs] to jobs:, seem to work, however.

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

3 participants