Class: Fulmar::Infrastructure::Service::FlowService

Inherits:
Object
  • Object
show all
Defined in:
lib/fulmar/infrastructure/service/flow_service.rb

Overview

Implements Flow commands

Instance Method Summary collapse

Constructor Details

#initialize(shell, config) ⇒ FlowService

Returns a new instance of FlowService.

Parameters:



8
9
10
11
# File 'lib/fulmar/infrastructure/service/flow_service.rb', line 8

def initialize(shell, config)
  @remote_shell = shell
  @config = config
end

Instance Method Details

#cache_clearObject



13
14
15
# File 'lib/fulmar/infrastructure/service/flow_service.rb', line 13

def cache_clear
  execute('flow:cache:flush --force')
end

#cache_warmupObject



17
18
19
# File 'lib/fulmar/infrastructure/service/flow_service.rb', line 17

def cache_warmup
  execute('flow:cache:warmup')
end

#execute(command) ⇒ Object



30
31
32
# File 'lib/fulmar/infrastructure/service/flow_service.rb', line 30

def execute(command)
  @remote_shell.run "FLOW_CONTEXT=\"#{@config[:neos][:environment]}\" ./flow #{command}"
end

#site_export(filename = export_filename) ⇒ Object



21
22
23
24
# File 'lib/fulmar/infrastructure/service/flow_service.rb', line 21

def site_export(filename = export_filename)
  execute("typo3.neos:site:export --filename \"#{filename}\"")
  filename
end

#site_import(filename) ⇒ Object



26
27
28
# File 'lib/fulmar/infrastructure/service/flow_service.rb', line 26

def site_import(filename)
  execute("./flow typo3.neos:site:import --filename \"#{filename}\"")
end