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
12 changes: 12 additions & 0 deletions config/packages/flysystem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
49 changes: 49 additions & 0 deletions config/packages/process/demo.flysystem.fetch_missing_input.yaml
Original file line number Diff line number Diff line change
@@ -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'
61 changes: 61 additions & 0 deletions config/packages/process/demo.flysystem.fetch_multiple_inputs.yaml
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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'
54 changes: 54 additions & 0 deletions config/packages/process/demo.flysystem.remove_files_input.yaml
Original file line number Diff line number Diff line change
@@ -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'
54 changes: 54 additions & 0 deletions config/packages/process/demo.flysystem.remove_missing_file.yaml
Original file line number Diff line number Diff line change
@@ -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'
Loading