Sha256: b1a3e3bd99ac965763fcd70a50b9bcb857d9d9aa0346d05bee2e7879c5d7e129

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

module Fulmar
  module Infrastructure
    module Service
      # Implements Flow commands
      class FlowService
        # @param [Fulmar::Infrastructure::Service::ShellService] shell
        # @param [Hash] config
        def initialize(shell, config)
          @remote_shell = shell
          @config = config
        end

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

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

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

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

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

        protected

        def export_filename
          "export_#{Time.now.strftime('%Y-%m-%dT%H%M%S')}.xml"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fulmar-1.2.0 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.1.0 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.0.0 lib/fulmar/infrastructure/service/flow_service.rb