 ArchiveCompress
ArchiveCompress
Compress an archive file.
Take an inputtedor downloaded file(s) and compress for upload to another location.
type: "io.kestra.plugin.compress.ArchiveCompress"Examples
Compress an input file
id: archive_compress
namespace: company.team
inputs:
  - id: file
    type: FILE
tasks:
  - id: "archive_compress"
    type: "io.kestra.plugin.compress.ArchiveCompress"
    from:
      myfile.txt: "{{ inputs.file }}"
    algorithm: ZIP
Download two files, compress them together and upload to S3 bucket
id: archive_compress
namespace: company.team
tasks:
  - id: products_download
    type: io.kestra.plugin.core.http.Download
    uri: "http://huggingface.co/datasets/kestra/datasets/raw/main/csv/products.csv"
  - id: orders_download
    type: io.kestra.plugin.core.http.Download
    uri: "https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv"
  - id: archive_compress
    type: "io.kestra.plugin.compress.ArchiveCompress"
    from:
      products.csv: "{{ outputs.products_download.uri }}"
      orders.csv: "{{ outputs.orders_download.uri }}"
    algorithm: TAR
    compression: GZIP
  - id: upload_compressed
    type: io.kestra.plugin.aws.s3.Upload
    bucket: "example"
    region: "{{ secret('AWS_REGION') }}"
    accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
    secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
    from: "{{ outputs.archive_compress.uri }}"
    key: "archive.gz"
Properties
algorithm *Requiredstring
ARARJCPIODUMPJARTARZIPThe algorithm of the archive file
from *Requiredobject
The files to compress.
The key must be a valid path in the archive and can contain / to represent the directory, the value must be a Kestra internal storage URI.
The value can also be a JSON containing multiple keys/values.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
compression string
BROTLIBZIP2DEFLATEDEFLATE64GZIPLZ4BLOCKLZ4FRAMELZMASNAPPYSNAPPYFRAMEXZZZSTDThe compression used for the archive file. Some algorithms focus on compressing individual files (for example GZIP), while others compress and combine multiple files into a single archive. The single-file compressor is often used alongside a separate tool for archiving multiple files (TAR and GZIP for example)
Outputs
uri string
uriURI of the compressed archive file on Kestra's internal storage.
