Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions config/packages/process/demo.archive.unzip_invalid_input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
clever_age_process:
configurations:
demo.archive.unzip_invalid_input:
description: >
Send a string (the archive path) to UnzipTask instead of an array. The task must fail with a clear
message on the input type (cleverage/archive-process-bundle#18).
help: >
Ex: bin/console cleverage:process:execute demo.archive.unzip_invalid_input
options:
ui:
source: Bar
target: Foo
tasks:
filename:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output: '%kernel.project_dir%/var/data/archive.zip'
outputs: [unzip]

unzip:
service: '@CleverAge\ArchiveProcessBundle\Task\UnzipTask'
options:
destination: '%kernel.project_dir%/var/data/unzip_archive'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
22 changes: 22 additions & 0 deletions config/packages/process/demo.archive.unzip_not_a_zip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
clever_age_process:
configurations:
demo.archive.unzip_not_a_zip:
description: >
Extract a file that is not a zip archive. The error message must give the ZipArchive error code, as
ZipTask does (cleverage/archive-process-bundle#17).
help: >
Ex: bin/console cleverage:process:execute demo.archive.unzip_not_a_zip
options:
ui:
source: Bar
target: Foo
tasks:
unzip:
service: '@CleverAge\ArchiveProcessBundle\Task\UnzipTask'
options:
filename: '%kernel.project_dir%/var/data/sample.txt'
destination: '%kernel.project_dir%/var/data/unzip_archive'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
22 changes: 22 additions & 0 deletions config/packages/process/demo.archive.unzip_write_failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
clever_age_process:
configurations:
demo.archive.unzip_write_failure:
description: >
Extract an archive into a destination that is an existing file. The task must fail instead of outputting
the destination as if the extraction had succeeded (run it with --no-debug: in debug mode, the PHP warning is turned into an exception) (cleverage/archive-process-bundle#17).
help: >
Ex: bin/console --no-debug cleverage:process:execute demo.archive.unzip_write_failure
options:
ui:
source: Bar
target: Foo
tasks:
unzip:
service: '@CleverAge\ArchiveProcessBundle\Task\UnzipTask'
options:
filename: '%kernel.project_dir%/var/data/archive.zip'
destination: '%kernel.project_dir%/var/data/sample.txt'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
41 changes: 41 additions & 0 deletions config/packages/process/demo.archive.zip_files_base_path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
clever_age_process:
configurations:
demo.archive.zip_files_base_path:
description: >
Zip a file whose path contains files_base_path twice: only the leading files_base_path must be removed
to build the archive entry name (cleverage/archive-process-bundle#16).
help: >
Ex: bin/console cleverage:process:execute demo.archive.zip_files_base_path && unzip -l var/data/demo_zip_files_base_path.zip
options:
ui:
source: Bar
target: Foo
tasks:
# Extracts archived_file.txt into <files_base_path>/backup/<files_base_path>/
unzip:
service: '@CleverAge\ArchiveProcessBundle\Task\UnzipTask'
options:
filename: '%kernel.project_dir%/var/data/archive.zip'
destination: 'var/data/demo_zip_files_base_path/backup/var/data'
outputs: [zip_input]

# UnzipTask outputs the destination directory (a string): replace it with the ZipTask input
zip_input:
service: '@CleverAge\ProcessBundle\Task\TransformerTask'
options:
transformers:
constant:
constant:
files: 'var/data/demo_zip_files_base_path/backup/var/data/archived_file.txt'
outputs: [zip]

# Paths are relative to the project directory: expected entry "demo_zip_files_base_path/backup/var/data/archived_file.txt"
zip:
service: '@CleverAge\ArchiveProcessBundle\Task\ZipTask'
options:
filename: '%kernel.project_dir%/var/data/demo_zip_files_base_path.zip'
files_base_path: 'var/data'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
31 changes: 31 additions & 0 deletions config/packages/process/demo.archive.zip_multiple_inputs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
clever_age_process:
configurations:
demo.archive.zip_multiple_inputs:
description: >
Send two inputs to the same ZipTask, each with its own archive filename and file. Two archives must be
created, one per input (cleverage/archive-process-bundle#15).
help: >
Ex: bin/console cleverage:process:execute demo.archive.zip_multiple_inputs && ls var/data/demo_zip_multiple_inputs_*
options:
ui:
source: Bar
target: Foo
tasks:
inputs:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
options:
output:
- filename: '%kernel.project_dir%/var/data/demo_zip_multiple_inputs_1.zip'
files: '%kernel.project_dir%/var/data/sample.txt'
- filename: '%kernel.project_dir%/var/data/demo_zip_multiple_inputs_2.zip'
files: '%kernel.project_dir%/var/data/sample.csv'
outputs: [zip]

zip:
service: '@CleverAge\ArchiveProcessBundle\Task\ZipTask'
options:
files_base_path: '%kernel.project_dir%/var/data'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
22 changes: 22 additions & 0 deletions config/packages/process/demo.archive.zip_relative_path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
clever_age_process:
configurations:
demo.archive.zip_relative_path:
description: >
Zip a file given by a path relative to the current directory, without files_base_path. The file must be
found (cleverage/archive-process-bundle#16).
help: >
Ex: bin/console cleverage:process:execute demo.archive.zip_relative_path (from the project directory)
options:
ui:
source: Bar
target: Foo
tasks:
zip:
service: '@CleverAge\ArchiveProcessBundle\Task\ZipTask'
options:
filename: '%kernel.project_dir%/var/data/demo_zip_relative_path.zip'
files: 'var/data/sample.txt'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
23 changes: 23 additions & 0 deletions config/packages/process/demo.archive.zip_write_failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
clever_age_process:
configurations:
demo.archive.zip_write_failure:
description: >
Zip a file into an archive located in a missing directory. The task must fail instead of outputting the
path of an archive that was never written (run it with --no-debug: in debug mode, the PHP warning is turned into an exception) (cleverage/archive-process-bundle#17).
help: >
Ex: bin/console --no-debug cleverage:process:execute demo.archive.zip_write_failure
options:
ui:
source: Bar
target: Foo
tasks:
zip:
service: '@CleverAge\ArchiveProcessBundle\Task\ZipTask'
options:
filename: '%kernel.project_dir%/var/data/missing_directory/demo_zip_write_failure.zip'
files: '%kernel.project_dir%/var/data/sample.txt'
files_base_path: '%kernel.project_dir%/var/data'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
Loading