diff --git a/config/packages/process/demo.archive.unzip_invalid_input.yaml b/config/packages/process/demo.archive.unzip_invalid_input.yaml new file mode 100644 index 0000000..243c52c --- /dev/null +++ b/config/packages/process/demo.archive.unzip_invalid_input.yaml @@ -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' diff --git a/config/packages/process/demo.archive.unzip_not_a_zip.yaml b/config/packages/process/demo.archive.unzip_not_a_zip.yaml new file mode 100644 index 0000000..593daec --- /dev/null +++ b/config/packages/process/demo.archive.unzip_not_a_zip.yaml @@ -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' diff --git a/config/packages/process/demo.archive.unzip_write_failure.yaml b/config/packages/process/demo.archive.unzip_write_failure.yaml new file mode 100644 index 0000000..ea8b9e4 --- /dev/null +++ b/config/packages/process/demo.archive.unzip_write_failure.yaml @@ -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' diff --git a/config/packages/process/demo.archive.zip_files_base_path.yaml b/config/packages/process/demo.archive.zip_files_base_path.yaml new file mode 100644 index 0000000..dafcdb6 --- /dev/null +++ b/config/packages/process/demo.archive.zip_files_base_path.yaml @@ -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 /backup// + 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' diff --git a/config/packages/process/demo.archive.zip_multiple_inputs.yaml b/config/packages/process/demo.archive.zip_multiple_inputs.yaml new file mode 100644 index 0000000..94e8be4 --- /dev/null +++ b/config/packages/process/demo.archive.zip_multiple_inputs.yaml @@ -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' diff --git a/config/packages/process/demo.archive.zip_relative_path.yaml b/config/packages/process/demo.archive.zip_relative_path.yaml new file mode 100644 index 0000000..a407942 --- /dev/null +++ b/config/packages/process/demo.archive.zip_relative_path.yaml @@ -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' diff --git a/config/packages/process/demo.archive.zip_write_failure.yaml b/config/packages/process/demo.archive.zip_write_failure.yaml new file mode 100644 index 0000000..993a94a --- /dev/null +++ b/config/packages/process/demo.archive.zip_write_failure.yaml @@ -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'