Fix.
This commit is contained in:
parent
2e42751aa8
commit
6061d0a5f3
|
@ -47,6 +47,8 @@ namespace :create_site do
|
||||||
extra_exclude_path = ",public/uploads/"
|
extra_exclude_path = ",public/uploads/"
|
||||||
end
|
end
|
||||||
server = SiteServer.where(:server_name => template_site.server_type).first
|
server = SiteServer.where(:server_name => template_site.server_type).first
|
||||||
|
ls_out = exec_ssh_command_for_create(ssh, "ls #{@site_construct.full_site_path}/app").join("\n")
|
||||||
|
if ls_out.include?("No such")
|
||||||
if @site_construct.server_type == template_site.server_type
|
if @site_construct.server_type == template_site.server_type
|
||||||
exec_ssh_command_for_create(ssh,"rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*#{extra_exclude_path}} #{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true)
|
exec_ssh_command_for_create(ssh,"rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*#{extra_exclude_path}} #{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true)
|
||||||
else
|
else
|
||||||
|
@ -58,6 +60,7 @@ namespace :create_site do
|
||||||
exec_ssh_command_for_create(ssh,"sshpass -p \"#{server.password}\" rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*#{extra_exclude_path}} #{server.account}@#{server.ip}:#{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true)
|
exec_ssh_command_for_create(ssh,"sshpass -p \"#{server.password}\" rsync -arv --delete --exclude={tmp/cache/,tmp/unicorn.sock,tmp/pids/*#{extra_exclude_path}} #{server.account}@#{server.ip}:#{template_site.path}/#{template_site.get_site_name}/ #{args.path}/#{@site_construct.get_site_name}/",true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
update_infos("Finish copying site's files for #{args.site_name}!")
|
update_infos("Finish copying site's files for #{args.site_name}!")
|
||||||
|
|
||||||
exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' chown #{args.user}:#{args.user} #{args.path}/#{@site_construct.get_site_name} -R")
|
exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' chown #{args.user}:#{args.user} #{args.path}/#{@site_construct.get_site_name} -R")
|
||||||
|
|
|
@ -97,10 +97,10 @@ namespace :exec_commands do
|
||||||
sites = [@site_construct]
|
sites = [@site_construct]
|
||||||
end
|
end
|
||||||
if args.commands.include?("{{create_users}}")
|
if args.commands.include?("{{create_users}}")
|
||||||
commands = ['sudo -p "sudo password:" chmod 700 {{full_site_path}} -R',
|
commands = ['sudo -p "sudo password:" chmod 777 {{full_site_path}} -R',
|
||||||
'sudo -p "sudo password:" chmod 755 {{full_site_path}}/public -R'
|
'sudo -p "sudo password:" chmod 777 {{full_site_path}}/public -R',
|
||||||
'sudo -p "sudo password:" chmod 755 {{full_site_path}}/app/templates -R'
|
'sudo -p "sudo password:" chmod 777 {{full_site_path}}/app/templates -R',
|
||||||
'sudo -p "sudo password:" useradd --home-dir {{full_site_path}}/app/templates {{site_name}} --no-create-home --badnames'
|
'sudo -p "sudo password:" useradd --home-dir {{full_site_path}}/app/templates {{site_name}} --no-create-home --badnames',
|
||||||
'sudo -p "sudo password:" bash -l -c \'echo -e "{{site_name}}\n{{site_name}}"|passwd {{site_name}}\'']
|
'sudo -p "sudo password:" bash -l -c \'echo -e "{{site_name}}\n{{site_name}}"|passwd {{site_name}}\'']
|
||||||
else
|
else
|
||||||
commands = args.commands.split("////").select{|c| c != ""} rescue [args.commands]
|
commands = args.commands.split("////").select{|c| c != ""} rescue [args.commands]
|
||||||
|
|
Loading…
Reference in New Issue