Skip to content
Snippets Groups Projects
Commit 046043ec authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[FEATURE] Allow local file synchronisations

parent a437ead9
No related branches found
No related tags found
No related merge requests found
...@@ -230,8 +230,10 @@ end ...@@ -230,8 +230,10 @@ end
######################### #########################
node['typo3_site']['sync_directories'].each do |sync_data| node['typo3_site']['sync_directories'].each do |sync_data|
ssh_known_hosts_entry sync_data['hostname'] do if sync_data['hostname']
port sync_data['port'] ssh_known_hosts_entry sync_data['hostname'] do
port sync_data['port']
end
end end
bash 'Synchronize ' + sync_data['local'] do bash 'Synchronize ' + sync_data['local'] do
...@@ -242,11 +244,18 @@ node['typo3_site']['sync_directories'].each do |sync_data| ...@@ -242,11 +244,18 @@ node['typo3_site']['sync_directories'].each do |sync_data|
sync_data['sync'] or not ::File.exists?("#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}") sync_data['sync'] or not ::File.exists?("#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}")
} }
code <<-EOF if sync_data['hostname']
rsync --delete -auvz --progress -e "ssh -p #{sync_data['port']} -o StrictHostKeyChecking=no" \ code <<-EOF
--no-o --no-g #{sync_data['user']}@#{sync_data['hostname']}:#{sync_data['remote']} \ 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']} \
"#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}";
EOF
else
code <<-EOF
rsync --delete -auvz --progress --no-o --no-g #{sync_data['remote']} \
"#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}"; "#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}";
EOF EOF
end
action :run action :run
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment