diff --git a/attributes/default.rb b/attributes/default.rb index b0bed3cb89ae784d9d286fab270d4c4f2f7839f8..f7b2143138f2df023e1134f147d0173fd67b159f 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -40,14 +40,16 @@ default['typo3_site']['solr']['cores'] = [ # :hostname => 'deploy.site.com', # :port => 22, # :remote => '~/site/fileadmin/', -# :local => 'fileadmin' +# :local => 'fileadmin', +# :sync => true # }, # { # :user => 'vagrant', # :hostname => 'deploy.site.com', # :port => 22, # :remote => '~/site/uploads/', -# :local => 'uploads' +# :local => 'uploads', +# :sync => true # } #] default['typo3_site']['sync_directories'] = [] diff --git a/recipes/default.rb b/recipes/default.rb index 09c228accbc5ee858a6d6ea4c001cc84e5275f84..36ebd17bd3454634d1c0236731d0a375ffa77fd2 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -238,6 +238,10 @@ node['typo3_site']['sync_directories'].each do |sync_data| user 'vagrant' group 'vagrant' timeout 3000000 + only_if { + sync_data['sync'] or not ::File.exists?("#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}") + } + code <<-EOF rsync --delete -auvz --progress -e "ssh -p #{sync_data['port']} -o StrictHostKeyChecking=no" \ --no-o --no-g #{sync_data['user']}@#{sync_data['hostname']}:#{sync_data['remote']} \