fix some error
This commit is contained in:
parent
702aa493c8
commit
ae2735fb5f
|
@ -1,5 +1,5 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
#complete!!!!!!!!
|
#complete2!!!!!!!!
|
||||||
#social gems
|
#social gems
|
||||||
gem "omniauth-google-oauth2"
|
gem "omniauth-google-oauth2"
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ gem 'impressionist', '~> 1.5.2'
|
||||||
gem 'chartkick', '~> 2.3.5'
|
gem 'chartkick', '~> 2.3.5'
|
||||||
gem 'usagewatch_ext'
|
gem 'usagewatch_ext'
|
||||||
gem 'ckeditor', '~> 4.2.4'
|
gem 'ckeditor', '~> 4.2.4'
|
||||||
gem 'unicorn', '~> 5.4.1'
|
gem 'unicorn', '~> 5.4.0'
|
||||||
gem 'zhconv'
|
gem 'zhconv'
|
||||||
gem 'time_difference'
|
gem 'time_difference'
|
||||||
gem 'execjs'
|
gem 'execjs'
|
||||||
|
|
|
@ -134,7 +134,16 @@ class Admin::SitesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_update_history
|
def get_update_history
|
||||||
@update_log = %x{git log --pretty=format:"%H','%ad','%s" --date=short}.split("\n").map{|log| log.gsub("'","").split(",")}.to_json
|
update_log = %x{git log --pretty=format:"%H','%ad','%s" --date=short}.split("\n")
|
||||||
|
emergency_log = %x{git reflog --pretty=format:"%H','%ad','%s" --date=short}.split("\n")
|
||||||
|
@update_log = update_log.collect do |v|
|
||||||
|
if v.include? 'complete_update_'
|
||||||
|
tmp = emergency_log.select{|v1| v1.exclude?('complete_update_') && v1.include?(v.split(/complete_update_/)[-1])}[0] rescue []
|
||||||
|
[v,tmp]
|
||||||
|
else
|
||||||
|
v
|
||||||
|
end
|
||||||
|
end.flatten.map{|log| log.gsub("'","").split(",")}.to_json
|
||||||
render :json => @update_log
|
render :json => @update_log
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -165,7 +174,7 @@ class Admin::SitesController < OrbitAdminController
|
||||||
"#{git} add -f '#{v}'"
|
"#{git} add -f '#{v}'"
|
||||||
end.join(' && ')
|
end.join(' && ')
|
||||||
time_now = Time.now.strftime('%Y_%m_%d_%H_%M')
|
time_now = Time.now.strftime('%Y_%m_%d_%H_%M')
|
||||||
Bundler.with_clean_env{system("#{git_add_except_public} && #{git} commit -m auto_backup_before_#{type}_#{time_now} && #{git} reset #{commit} --mixed && #{git_add_all_program} && #{git} reset #{commit} --merge && #{git} commit -m complete_#{type}_#{time_now}")}
|
Bundler.with_clean_env{system("#{git_add_except_public} && #{git} commit -m auto_backup_before_#{type}_#{time_now} && #{git} reset #{commit} --mixed && #{git_add_all_program} && #{git} reset #{commit} --merge && #{git_add_except_public}&& #{git} commit -m complete_#{type}_#{time_now}")}
|
||||||
mul.update_attributes(status: 'finish')
|
mul.update_attributes(status: 'finish')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -196,8 +205,8 @@ class Admin::SitesController < OrbitAdminController
|
||||||
def restart_server
|
def restart_server
|
||||||
mode = Rails.env
|
mode = Rails.env
|
||||||
unicorn_rails = %x[which unicorn_rails].sub("\n",'')
|
unicorn_rails = %x[which unicorn_rails].sub("\n",'')
|
||||||
Bundler.with_clean_env{system("kill -s TERM `cat tmp/pids/unicorn.pid` && unset UNICORN_FD && sleep 1 && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}")}
|
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
|
Bundler.with_clean_env{system("kill -s TERM `cat tmp/pids/unicorn.pid` && unset UNICORN_FD && sleep 1 && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}")}
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -273,10 +273,8 @@
|
||||||
$.get("<%= admin_site_update_orbit_path %>",{type: type,id: id},function(result){
|
$.get("<%= admin_site_update_orbit_path %>",{type: type,id: id},function(result){
|
||||||
if (result=='finish'){
|
if (result=='finish'){
|
||||||
$("#progress_msg").html("<strong><%= t("update_manager_.restart_server") %></strong>");
|
$("#progress_msg").html("<strong><%= t("update_manager_.restart_server") %></strong>");
|
||||||
$.get("<%= admin_site_restart_server_path %>",function(result){
|
$.get("<%= admin_site_restart_server_path %>").always(function(){
|
||||||
$("#update_progress").fadeOut(function(){$("#update_done").fadeIn();});
|
setTimeout(function(){window.location.href="<%= admin_site_update_manager_path %>"},5000)
|
||||||
$("#update_status").fadeIn();
|
|
||||||
get_update_history();
|
|
||||||
});
|
});
|
||||||
}else if(result=='waiting'){
|
}else if(result=='waiting'){
|
||||||
$("#progress_msg").html("<strong><%= t("update_manager_.restart_server") %></strong>");
|
$("#progress_msg").html("<strong><%= t("update_manager_.restart_server") %></strong>");
|
||||||
|
|
Loading…
Reference in New Issue