diff --git a/config/packages/flysystem.yaml b/config/packages/flysystem.yaml index 6a57dde..4de704c 100644 --- a/config/packages/flysystem.yaml +++ b/config/packages/flysystem.yaml @@ -14,6 +14,18 @@ flysystem: options: directory: '%kernel.project_dir%/var/storage/fetch_failure' + # Source and destination storages of the FileFetchTask / RemoveFileTask demos + # (demo.flysystem.fetch_* / demo.flysystem.remove_*), emptied by each demo. + local.storage.fetch_source: + adapter: 'local' + options: + directory: '%kernel.project_dir%/var/storage/fetch_source' + + local.storage.fetch_destination: + adapter: 'local' + options: + directory: '%kernel.project_dir%/var/storage/fetch_destination' + remote.storage: adapter: 'sftp' options: diff --git a/config/packages/process/demo.flysystem.fetch_missing_input.yaml b/config/packages/process/demo.flysystem.fetch_missing_input.yaml new file mode 100644 index 0000000..bbd2d3d --- /dev/null +++ b/config/packages/process/demo.flysystem.fetch_missing_input.yaml @@ -0,0 +1,49 @@ +clever_age_process: + configurations: + demo.flysystem.fetch_missing_input: + description: > + FileFetchTask receiving a missing file with ignore_missing: true, the default + (cleverage/flysystem-process-bundle#39): the missing file must be skipped, the other ones copied + help: > + Ex: bin/console cleverage:process:execute demo.flysystem.fetch_missing_input && ls var/storage/fetch_source var/storage/fetch_destination + tasks: + clean: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + description: Empty both storages + options: + output: + - '%kernel.project_dir%/var/storage/fetch_source' + - '%kernel.project_dir%/var/storage/fetch_destination' + outputs: [ remove_storages ] + + remove_storages: + service: '@CleverAge\ProcessBundle\Task\File\FileRemoverTask' + outputs: [ content ] + + content: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + options: + output: 'Some data' + outputs: [ write_0 ] + + write_0: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/a.txt' + outputs: [ inputs ] + + inputs: + service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask' + options: + output: [ 'missing.txt', 'a.txt' ] + outputs: [ task ] + + task: + service: '@CleverAge\FlysystemProcessBundle\Task\FileFetchTask' + options: + source_filesystem: 'local.storage.fetch_source' + destination_filesystem: 'local.storage.fetch_destination' + outputs: [ debug ] + + debug: + service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask' diff --git a/config/packages/process/demo.flysystem.fetch_multiple_inputs.yaml b/config/packages/process/demo.flysystem.fetch_multiple_inputs.yaml new file mode 100644 index 0000000..0293fbd --- /dev/null +++ b/config/packages/process/demo.flysystem.fetch_multiple_inputs.yaml @@ -0,0 +1,61 @@ +clever_age_process: + configurations: + demo.flysystem.fetch_multiple_inputs: + description: > + FileFetchTask receiving several file paths (cleverage/flysystem-process-bundle#38, #40): each input + must be copied, including a path received twice and a file named "0" + help: > + Ex: bin/console cleverage:process:execute demo.flysystem.fetch_multiple_inputs && ls var/storage/fetch_source var/storage/fetch_destination + tasks: + clean: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + description: Empty both storages + options: + output: + - '%kernel.project_dir%/var/storage/fetch_source' + - '%kernel.project_dir%/var/storage/fetch_destination' + outputs: [ remove_storages ] + + remove_storages: + service: '@CleverAge\ProcessBundle\Task\File\FileRemoverTask' + outputs: [ content ] + + content: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + options: + output: 'Some data' + outputs: [ write_0 ] + + write_0: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/a.txt' + outputs: [ write_1 ] + + write_1: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/b.txt' + outputs: [ write_2 ] + + write_2: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/0' + outputs: [ inputs ] + + inputs: + service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask' + options: + output: [ 'a.txt', 'b.txt', 'a.txt', '0' ] + outputs: [ task ] + + task: + service: '@CleverAge\FlysystemProcessBundle\Task\FileFetchTask' + options: + source_filesystem: 'local.storage.fetch_source' + destination_filesystem: 'local.storage.fetch_destination' + outputs: [ debug ] + + debug: + service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask' diff --git a/config/packages/process/demo.flysystem.fetch_pattern_multiple_inputs.yaml b/config/packages/process/demo.flysystem.fetch_pattern_multiple_inputs.yaml new file mode 100644 index 0000000..80adec6 --- /dev/null +++ b/config/packages/process/demo.flysystem.fetch_pattern_multiple_inputs.yaml @@ -0,0 +1,56 @@ +clever_age_process: + configurations: + demo.flysystem.fetch_pattern_multiple_inputs: + description: > + FileFetchTask with file_pattern receiving several inputs (cleverage/flysystem-process-bundle#38): the + matching files must be copied for each input + help: > + Ex: bin/console cleverage:process:execute demo.flysystem.fetch_pattern_multiple_inputs && ls var/storage/fetch_source var/storage/fetch_destination + tasks: + clean: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + description: Empty both storages + options: + output: + - '%kernel.project_dir%/var/storage/fetch_source' + - '%kernel.project_dir%/var/storage/fetch_destination' + outputs: [ remove_storages ] + + remove_storages: + service: '@CleverAge\ProcessBundle\Task\File\FileRemoverTask' + outputs: [ content ] + + content: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + options: + output: 'Some data' + outputs: [ write_0 ] + + write_0: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/a.txt' + outputs: [ write_1 ] + + write_1: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/b.txt' + outputs: [ inputs ] + + inputs: + service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask' + options: + output: [ 'first', 'second' ] + outputs: [ task ] + + task: + service: '@CleverAge\FlysystemProcessBundle\Task\FileFetchTask' + options: + source_filesystem: 'local.storage.fetch_source' + destination_filesystem: 'local.storage.fetch_destination' + file_pattern: '/\.txt$/' + outputs: [ debug ] + + debug: + service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask' diff --git a/config/packages/process/demo.flysystem.remove_files_input.yaml b/config/packages/process/demo.flysystem.remove_files_input.yaml new file mode 100644 index 0000000..73e8e76 --- /dev/null +++ b/config/packages/process/demo.flysystem.remove_files_input.yaml @@ -0,0 +1,54 @@ +clever_age_process: + configurations: + demo.flysystem.remove_files_input: + description: > + RemoveFileTask receiving a list of paths (cleverage/flysystem-process-bundle#41): each file must be + deleted + help: > + Ex: bin/console cleverage:process:execute demo.flysystem.remove_files_input && ls var/storage/fetch_source var/storage/fetch_destination + tasks: + clean: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + description: Empty both storages + options: + output: + - '%kernel.project_dir%/var/storage/fetch_source' + - '%kernel.project_dir%/var/storage/fetch_destination' + outputs: [ remove_storages ] + + remove_storages: + service: '@CleverAge\ProcessBundle\Task\File\FileRemoverTask' + outputs: [ content ] + + content: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + options: + output: 'Some data' + outputs: [ write_0 ] + + write_0: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/a.txt' + outputs: [ write_1 ] + + write_1: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/b.txt' + outputs: [ inputs ] + + inputs: + service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask' + options: + output: [ [ 'a.txt', 'b.txt' ] ] + outputs: [ task ] + + task: + service: '@CleverAge\FlysystemProcessBundle\Task\RemoveFileTask' + options: + filesystem: 'local.storage.fetch_source' + outputs: [ debug ] + + debug: + service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask' diff --git a/config/packages/process/demo.flysystem.remove_missing_file.yaml b/config/packages/process/demo.flysystem.remove_missing_file.yaml new file mode 100644 index 0000000..6b8d8a9 --- /dev/null +++ b/config/packages/process/demo.flysystem.remove_missing_file.yaml @@ -0,0 +1,54 @@ +clever_age_process: + configurations: + demo.flysystem.remove_missing_file: + description: > + RemoveFileTask receiving a missing file and a directory (cleverage/flysystem-process-bundle#41): + run with -v, the missing file must not be logged as deleted + help: > + Ex: bin/console cleverage:process:execute demo.flysystem.remove_missing_file && ls var/storage/fetch_source var/storage/fetch_destination + tasks: + clean: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + description: Empty both storages + options: + output: + - '%kernel.project_dir%/var/storage/fetch_source' + - '%kernel.project_dir%/var/storage/fetch_destination' + outputs: [ remove_storages ] + + remove_storages: + service: '@CleverAge\ProcessBundle\Task\File\FileRemoverTask' + outputs: [ content ] + + content: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + options: + output: 'Some data' + outputs: [ write_0 ] + + write_0: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/a.txt' + outputs: [ write_1 ] + + write_1: + service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask' + options: + filename: '%kernel.project_dir%/var/storage/fetch_source/dir/b.txt' + outputs: [ inputs ] + + inputs: + service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask' + options: + output: [ 'a.txt', 'missing.txt', 'dir' ] + outputs: [ task ] + + task: + service: '@CleverAge\FlysystemProcessBundle\Task\RemoveFileTask' + options: + filesystem: 'local.storage.fetch_source' + outputs: [ debug ] + + debug: + service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'