mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2025-02-02 19:49:16 +01:00
added kestra boilerplates
This commit is contained in:
parent
3aeae37ce2
commit
743e25a974
19
kestra/python/command.yaml
Normal file
19
kestra/python/command.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Kestra Python Command Template
|
||||||
|
# ---
|
||||||
|
#
|
||||||
|
# This template is a simple Python script.
|
||||||
|
#
|
||||||
|
# usage:
|
||||||
|
# make sure the Kestra instance can access the /app/scripts/your-python-script.py file
|
||||||
|
# if you're running Kestra in Docker, use a volume to mount the file/directory.
|
||||||
|
|
||||||
|
id: python-command
|
||||||
|
namespace: # your-namespace
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- id: python_command
|
||||||
|
type: io.kestra.plugin.scripts.python.Commands
|
||||||
|
commands:
|
||||||
|
- python /app/scripts/your-python-script.py
|
||||||
|
runner: PROCESS # or DOCKER (might be deprecated in the future) use TaskRunner instead
|
28
kestra/python/script.yaml
Normal file
28
kestra/python/script.yaml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Kestra Python Command Template
|
||||||
|
# ---
|
||||||
|
#
|
||||||
|
# This template is a simple Python script that can be used to make a request to a website and log the status code.
|
||||||
|
#
|
||||||
|
|
||||||
|
id: python-script
|
||||||
|
namespace: # your-namespace
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- id: python_script
|
||||||
|
type: io.kestra.plugin.scripts.python.Script
|
||||||
|
runner: DOCKER # (might be deprecated in the future) use TaskRunner instead
|
||||||
|
script: |
|
||||||
|
from kestra import Kestra
|
||||||
|
import requests
|
||||||
|
|
||||||
|
response = requests.get('{{inputs.website}}')
|
||||||
|
print(response.status_code)
|
||||||
|
|
||||||
|
Kestra.outputs({'status': response.status_code, 'text': response.text})
|
||||||
|
beforeCommands:
|
||||||
|
- pip install requests kestra
|
||||||
|
|
||||||
|
- id: log
|
||||||
|
type: io.kestra.core.tasks.log.Log
|
||||||
|
message: "StatusCode: {{outputs.pythonscript.vars.status}}"
|
18
kestra/webhook.yaml
Normal file
18
kestra/webhook.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Kestra Webhook Template
|
||||||
|
# ---
|
||||||
|
#
|
||||||
|
# This template is a simple webhook trigger that can be used to trigger a task execution.
|
||||||
|
#
|
||||||
|
# usage:
|
||||||
|
# curl http://your-kestra-instance/api/v1/executions/webhook/your-namespace/your-task-id/your-secret-key
|
||||||
|
|
||||||
|
id: webhook
|
||||||
|
namespace: # your-namespace
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
# your-tasks
|
||||||
|
|
||||||
|
triggers:
|
||||||
|
- id: webhook
|
||||||
|
type: io.kestra.core.models.triggers.types.Webhook
|
||||||
|
key: # your-secret-key, keep this secret!
|
Loading…
Reference in New Issue
Block a user