This commit is contained in:
BoHung Chiu 2022-01-14 11:40:20 +08:00
parent 6061d0a5f3
commit 6161a1a004
1 changed files with 1 additions and 1 deletions

View File

@ -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