Fix bug.
This commit is contained in:
parent
9cbf30c14a
commit
3d871aec8f
|
@ -20,6 +20,7 @@ namespace :create_site do
|
|||
@site_construct = SiteConstruct.find(args.site_construct_id)
|
||||
end
|
||||
begin
|
||||
org_creating = (@site_construct.status == "creating")
|
||||
@site_construct.update(:status=>"creating")
|
||||
@site_construct.update!(:infos=>[])
|
||||
begin
|
||||
|
@ -48,7 +49,7 @@ namespace :create_site do
|
|||
end
|
||||
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 ls_out.include?("No such") || org_creating
|
||||
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)
|
||||
else
|
||||
|
|
|
@ -132,11 +132,17 @@ namespace :create_site do
|
|||
end
|
||||
return outputs.join("\n")
|
||||
end
|
||||
def update_infos_for_exec(info,update_last=false)
|
||||
def update_infos_for_exec(info,update_last=false,update_array=false)
|
||||
return if @site_construct.nil?
|
||||
info.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
|
||||
if update_last && !@site_construct.infos.empty?
|
||||
@site_construct.infos[-1] += info
|
||||
@site_construct.infos[-1] += info.to_s
|
||||
else
|
||||
@site_construct.infos = @site_construct.infos.push(info)
|
||||
if update_array
|
||||
@site_construct.infos += info
|
||||
else
|
||||
@site_construct.infos.push(info.to_s)
|
||||
end
|
||||
end
|
||||
@site_construct.save!
|
||||
return @site_construct.infos
|
||||
|
|
|
@ -158,6 +158,7 @@ namespace :exec_commands do
|
|||
end
|
||||
def update_infos_for_exec(info,update_last=false,update_array=false)
|
||||
return if @site_construct.nil?
|
||||
info.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
|
||||
if update_last && !@site_construct.infos.empty?
|
||||
@site_construct.infos[-1] += info.to_s
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue