Skip to content

Instantly share code, notes, and snippets.

@memoryleak
Created May 13, 2023 15:01
Show Gist options
  • Save memoryleak/8d6aa2d8834b42f4b9e4fc5029a128f3 to your computer and use it in GitHub Desktop.
Save memoryleak/8d6aa2d8834b42f4b9e4fc5029a128f3 to your computer and use it in GitHub Desktop.
---
# See: https://crontab.guru/
schedule: '*/15 4 * * *'
# Default: never
# Possible values: on-success | on-failure | always | never
notify: on-failure
tasks:
- name: "Print hello" # Optional
# Provoding a key should make these available in following tasks:
# - tasks.print_hello.stdout
# - tasks.print_hello.stderr
# - tasks.print_hello.exit_code
key: 'print_hello' # Optional, Default: Tasks sequence number
ignore_errors: True # False by default
# If command is multiline, create a temporary .sh script and execute it.
command: | # Mandatory
#!/usr/bin/env bash
echo "Hello"
exit -1
- name: "Print hello world"
key: 'print_hello_world'
# Use jinja2 templating for tasks.* values
command: |
#!/usr/bin/env bash
echo "{{ tasks.print_hello.stdout }} World!"
exit 38
- command: "echo \"Result of previous task was: {{ tasks.print_hello.exit_code }}\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment