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

[BUGFIX] Stabilize the database import code

parent fa1d0b29
No related branches found
No related tags found
No related merge requests found
......@@ -276,8 +276,8 @@ template "#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/typ
owner 'vagrant'
mode '0660'
variables ({
:group_id => data_bag['groupId']
})
:group_id => data_bag['groupId']
})
end
template "#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/typo3conf/AdditionalConfiguration.php" do
......@@ -353,15 +353,15 @@ node['typo3_site']['sync_databases'].each do |database_data|
group data_bag['groupId']
timeout 3000000
code <<-EOF
rsync --delete -auvz --progress -e "ssh -p #{database_data['dump_port']} -o StrictHostKeyChecking=no" \
--no-o --no-g #{database_data['dump_user']}@#{database_data['dump_hostname']}:#{database_data['dump_remote']} \
#{database_data['dump_local']};
rsync --delete -auvz --progress -e "ssh -p #{database_data['dump_port']} -o StrictHostKeyChecking=no" \
--no-o --no-g #{database_data['dump_user']}@#{database_data['dump_hostname']}:#{database_data['dump_remote']} \
#{database_data['dump_local']};
EOF
action :run
end
end
if database_data['dump_local']
if database_data['dump_local'] and database_data['database_name']
# load the dump
bash 'Import Dump for ' + database_data['database_name'] do
code <<-EOF
......@@ -371,21 +371,23 @@ node['typo3_site']['sync_databases'].each do |database_data|
end
# causes still strange issues that leads to crashes of the MySQL server
# don't waste more time on this one as it seems like he is executing this as one
# really big sql query and then runs into heavy limitation issues. The way above is much more stable.
# mysql_database 'Import Dump for ' + database_data['database_name'] do
# connection connection_info
# database_name database_data['database_name']
# sql { ::File.open(database_data['dump_local']).read }
# action :query
# end
end
if database_data['post_install_queries']
database_data['post_install_queries'].each do |query|
mysql_database 'Execute Post Install Query' do
connection connection_info
database_name database_data['database_name']
sql query
action :query
if database_data['post_install_queries']
database_data['post_install_queries'].each do |query|
mysql_database 'Execute Post Install Query' do
connection connection_info
database_name database_data['database_name']
sql query
action :query
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