diff --git a/lib/tasks/copy_site.rake b/lib/tasks/copy_site.rake index e9fc626..e34d8cd 100644 --- a/lib/tasks/copy_site.rake +++ b/lib/tasks/copy_site.rake @@ -67,7 +67,7 @@ namespace :create_site do exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' chmod 777 #{args.path}/#{@site_construct.get_site_name} -R") db_setting_text = ssh.exec!("cat #{args.path}/#{args.site_name}/config/mongoid.yml") update_infos("setting dbname to #{args.db_name}") - exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{db_setting_text.gsub(template_site.db_name,args.db_name)}' > #{args.path}/#{@site_construct.get_site_name}/config/mongoid.yml\"",true) + exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{db_setting_text.gsub(/database: .+/,"database: "+args.db_name)}' > #{args.path}/#{@site_construct.get_site_name}/config/mongoid.yml\"",true) unless args.only_copy_installed_module == true || args.only_copy_installed_module == "true" update_infos("copying db from #{template_site.db_name} to #{args.db_name}") if @site_construct.server_type == template_site.server_type