LocalFiles
LocalFiles
⚠ Deprecated
type: "io.kestra.plugin.core.storage.LocalFiles"
Allow to create files in the local filesystem or to send files from the local filesystem to the Kestra's internal storage.
Replaced by inputFiles
property on the WorkingDirectory task - migration information here. Previously, this task should be used with the WorkingDirectory task to be able to access the same local filesystem within multiple tasks. Note that this task cannot be skipped, so setting disabled: true
will not work on this task.
Examples
Output local files created in a Python task and load them to S3.
id: outputsFromPythonTask
namespace: company.team
tasks:
- id: wdir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: cloneRepository
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/examples
branch: main
- id: gitPythonScripts
type: io.kestra.plugin.scripts.python.Commands
warningOnStdErr: false
runner: DOCKER
docker:
image: ghcr.io/kestra-io/pydata:latest
beforeCommands:
- pip install faker > /dev/null
commands:
- python scripts/etl_script.py
- python scripts/generate_orders.py
- id: exportFiles
type: io.kestra.plugin.core.storage.LocalFiles
outputs:
- orders.csv
- "*.parquet"
- id: loadCsvToS3
type: io.kestra.plugin.aws.s3.Upload
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
secretKeyId: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
region: eu-central-1
bucket: kestraio
key: stage/orders.csv
from: "{{ outputs.exportFiles.outputFiles['orders.csv'] }}"
disabled: true
Create a local file that will be accessible to a bash task.
id: "local-files"
namespace: "io.kestra.tests"
tasks:
- id: workingDir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: inputFiles
type: io.kestra.plugin.core.storage.LocalFiles
inputs:
hello.txt: "Hello World\n"
address.json: "{{ outputs.myTaskId.uri }}"
- id: bash
type: io.kestra.plugin.scripts.shell.Commands
commands:
- cat hello.txt
Send local files to Kestra's internal storage.
id: "local-files"
namespace: "io.kestra.tests"
tasks:
- id: workingDir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: bash
type: io.kestra.plugin.scripts.shell.Commands
commands:
- mkdir -p sub/dir
- echo "Hello from Bash" >> sub/dir/bash1.txt
- echo "Hello from Bash" >> sub/dir/bash2.txt
- id: outputFiles
type: io.kestra.plugin.core.storage.LocalFiles
outputs:
- sub/**
Properties
inputs
- Type:
- object
- string
- Dynamic: ✔️
- Required: ❌
The files to be created on the local filesystem. It can be a map or a JSON object.
outputs
- Type: array
- SubType: string
- Dynamic: ✔️
- Required: ❌
The files from the local filesystem to be sent to the Kestra's internal storage.
Must be a list of glob expressions relative to the current working directory, some examples:
my-dir/**
,my-dir/*/**
ormy-dir/my-file.txt
.
Outputs
uris
- Type: object
- SubType: string
- Dynamic: ❓
- Required: ❌
The URI of the files that have been sent to the Kestra's internal storage.
Definitions
Was this page helpful?