Sha256: c82eefe2987eba1b30e9e5f3244940097c49b66e5aa0e8bb8ae9f731926abf4e

Contents?: true

Size: 1.19 KB

Versions: 40

Compression:

Stored size: 1.19 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
          test_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

        def test_config
          fail 'Neos environment is not set.' unless @config[:neos] && @config[:neos][:environment]
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
fulmar-1.10.1 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.10.0 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.9.2 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.9.1 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.9.0 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.15 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.14 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.13 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.12 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.11 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.10 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.9 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.8 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.7 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.6 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.5 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.4 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.3 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.2 lib/fulmar/infrastructure/service/flow_service.rb
fulmar-1.8.1 lib/fulmar/infrastructure/service/flow_service.rb