Fix bug.
This commit is contained in:
parent
d1f3124ae4
commit
13da5a8c25
|
@ -35,7 +35,7 @@ namespace :create_site do
|
|||
update_infos("setting nginx for #{args.site_name}")
|
||||
nginx_setting_texts = @site_construct.generate_nginx_text
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"touch /etc/nginx/orbit_sites/#{@site_construct.get_site_name}")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{nginx_setting_texts.gsub(/'{1,3}/,"\"\'\"")}' > /etc/nginx/orbit_sites/#{@site_construct.get_site_name}\"")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"x='#{nginx_setting_texts.gsub(/'{1,3}/,"\"\'\"")}'; echo '#{@password}' | sudo -S sh -c \"echo '$x' > /etc/nginx/orbit_sites/#{@site_construct.get_site_name}\"")
|
||||
update_infos("restarting nginx")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' service nginx restart")
|
||||
update_infos("finish restarting nginx")
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace :create_site do
|
|||
update_infos("setting nginx for #{args.site_name}")
|
||||
nginx_setting_texts = @site_construct.generate_nginx_text
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"touch /etc/nginx/orbit_sites/#{@site_construct.get_site_name}")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{nginx_setting_texts.gsub(/'{1,3}/,"\"\'\"")}' > /etc/nginx/orbit_sites/#{@site_construct.get_site_name}\"")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"x='#{nginx_setting_texts.gsub(/'{1,3}/,"\"\'\"")}'; echo '#{@password}' | sudo -S sh -c \"echo '$x' > /etc/nginx/orbit_sites/#{@site_construct.get_site_name}\"")
|
||||
update_infos("restarting nginx")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' service nginx restart")
|
||||
update_infos("finish restarting nginx")
|
||||
|
@ -49,7 +49,7 @@ namespace :create_site do
|
|||
db_setting_text = ssh.exec!("cat #{args.path}/#{@site_construct.get_site_name}/config/mongoid.yml")
|
||||
update_infos("setting dbname to #{@site_construct.db_name}")
|
||||
exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{db_setting_text.gsub("orbit_4_5",@site_construct.db_name)}' > #{args.path}/#{@site_construct.get_site_name}/config/mongoid.yml\"",true)
|
||||
gemdir = ssh.exec!("/home/rulingcom/.rvm/bin/rvm gemdir").to_s
|
||||
gemdir = ssh.exec!("/home/#{args.user}/.rvm/bin/rvm gemdir").to_s
|
||||
if gemdir.include?("No such file or directory")
|
||||
ls = ssh.exec!("echo `ls /home`").to_s.split
|
||||
ls.each do |d|
|
||||
|
|
Loading…
Reference in New Issue