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
#########################
node['typo3_site']['sync_directories'].each do |sync_data|
ssh_known_hosts_entry sync_data['hostname'] do
port sync_data['port']
if sync_data['hostname']
ssh_known_hosts_entry sync_data['hostname'] do
port sync_data['port']
end
end
bash 'Synchronize ' + sync_data['local'] do
......@@ -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']}")
}
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']} \
if sync_data['hostname']
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']} \
"#{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']}";
EOF
EOF
end
action :run
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