Sha256: 7791734851630f202bff54c32b482306d9d2a54ab8a38133fa65e05b90171d5d

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

unless config.plugins[:neos].nil? || config.plugins[:neos][:sync].nil?
  namespace :sync do
    namespace :neos do
      config.plugins[:neos][:sync].each do |name, sync_config|
        desc "Sync Neos database and assets from #{name} system"
        task name do
          to_environment = sync_config[:to].split(':').first
          database_task = sync_config[:database_task] || "update:database:#{to_environment}:from_#{name}"
          Rake::Task[database_task].invoke if Rake::Task.task_defined?(database_task)

          config.set *sync_config[:from].split(':').map(&:to_sym)
          from_hostname = config[:hostname]
          current = config[:type] == 'rsync_with_versions' ? '/current' : ''
          from_path = "#{config[:remote_path]}#{current}/Data/Persistent/Resources"
          config.set *sync_config[:to].split(':').map(&:to_sym)
          info 'Syncing assets...'
          remote_shell.run "rsync -aq #{from_hostname}:#{from_path} Data/Persistent"
          info 'Publishing assets...'
          remote_shell.run './flow resource:publish'

          if config[:site_node_name] && config[:domain]
            info 'Adding domain...'
            remote_shell.run "./flow domain:add --site-node-name #{config[:site_node_name]} --hostname #{config[:domain]}"
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fulmar-plugin-neos-1.1.0 lib/fulmar/plugin/neos/rake/neos.rake