Fix bug.
This commit is contained in:
parent
a82e6bca92
commit
05a359e0fa
|
@ -35,6 +35,7 @@
|
||||||
<a href="#" title="<%=t("client_management.close_site_for_site",{:site=>site.domain_name})%>" class="btn btn-primary close_site" data-id="<%=site.id.to_s%>"><%=t('client_management.close_site')%></a>
|
<a href="#" title="<%=t("client_management.close_site_for_site",{:site=>site.domain_name})%>" class="btn btn-primary close_site" data-id="<%=site.id.to_s%>"><%=t('client_management.close_site')%></a>
|
||||||
<a href="#" title="Restart <%=site.domain_name%>" class="btn btn-primary open_site" data-id="<%=site.id.to_s%>"><%=t('client_management.restart_site')%></a>
|
<a href="#" title="Restart <%=site.domain_name%>" class="btn btn-primary open_site" data-id="<%=site.id.to_s%>"><%=t('client_management.restart_site')%></a>
|
||||||
<% elsif site.status == "closed" %>
|
<% elsif site.status == "closed" %>
|
||||||
|
<a href="#" title="<%=t("client_management.delete_site_for_site",{:site=>site.domain_name})%>" class="btn btn-primary delete_site" data-id="<%=site.id.to_s%>"><%=t('client_management.delete_site')%></a>
|
||||||
<a href="#" title="<%=t("client_management.start_site_for_site",{:site=>site.domain_name})%>" class="btn btn-primary open_site" data-id="<%=site.id.to_s%>"><%=t('client_management.start_site')%></a>
|
<a href="#" title="<%=t("client_management.start_site_for_site",{:site=>site.domain_name})%>" class="btn btn-primary open_site" data-id="<%=site.id.to_s%>"><%=t('client_management.start_site')%></a>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% if site.status.present? %>
|
<% if site.status.present? %>
|
||||||
|
|
|
@ -20,6 +20,11 @@ namespace :create_site do
|
||||||
end
|
end
|
||||||
Net::SSH.start(ip , user , password: password) do |ssh|
|
Net::SSH.start(ip , user , password: password) do |ssh|
|
||||||
@site_construct.update!(:infos=>[])
|
@site_construct.update!(:infos=>[])
|
||||||
|
if @site_construct.status != "closed"
|
||||||
|
update_infos("Closing site #{@site_construct.site_name}...")
|
||||||
|
end
|
||||||
|
exec_ssh_command_by_sudo(ssh,"kill -s TERM `cat tmp/pids/unicorn.pid`")
|
||||||
|
exec_ssh_command_by_sudo(ssh,"kill -s TERM `fuser tmp/unicorn.sock`")
|
||||||
update_infos("deleting database for #{@site_construct.site_name}")
|
update_infos("deleting database for #{@site_construct.site_name}")
|
||||||
db_name = exec_ssh_command_by_sudo(ssh,"echo `cat #{@site_construct.path}/#{@site_construct.get_site_name}/config/mongoid.yml | grep 'database'`").split("database:").last.strip
|
db_name = exec_ssh_command_by_sudo(ssh,"echo `cat #{@site_construct.path}/#{@site_construct.get_site_name}/config/mongoid.yml | grep 'database'`").split("database:").last.strip
|
||||||
exec_ssh_command_by_sudo(ssh,"bash -l -c 'echo \"db.dropDatabase()\" | mongo --shell \'#{db_name}\''")
|
exec_ssh_command_by_sudo(ssh,"bash -l -c 'echo \"db.dropDatabase()\" | mongo --shell \'#{db_name}\''")
|
||||||
|
|
Loading…
Reference in New Issue