diff --git a/announcement.gemspec b/announcement.gemspec index 7c8a8a2..7900087 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -90,17 +90,17 @@ if old_gemfile_text != new_gemfile_text f.puts exist_str } end - all_command = "#{command1} ; #{command2} #{command3} #{command4} ; kill -s TERM `cat tmp/pids/unicorn.pid` ; unset UNICORN_FD ; bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}|at now;" - all_command = all_command + "watch -n 30 \"unset UNICORN_FD && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}|at now\"" - file = File.new(File.join(env_pwd,'bundle_update_background.sh'),"w") - file.write(all_command) - file.chmod(0755) - file.close + all_command = "#{command1} ; #{command2} #{command3} #{command4} ; kill -s TERM `cat tmp/pids/unicorn.pid` ; unset UNICORN_FD ; bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}|at now" + watch_dog_cmd = "watch -n 30 \"unset UNICORN_FD && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}|at now\"" + #file = File.new(File.join(env_pwd,'bundle_update_background.sh'),"w") + #file.write(all_command) + #file.chmod(0755) + #file.close a = Thread.start do Bundler.with_clean_env do puts env_pwd puts mode - exec("cd #{env_pwd} && screen -d -m -S auto_reopen_#{dir_name} #{env_pwd}/bundle_update_background.sh ") + exec("cd #{env_pwd} && env -i HOME=\"$HOME\" bash -l -c \"#{all_command}\" ; screen -d -m -S auto_reopen_#{dir_name} #{watch_dog_cmd} ") end end now_priority = Thread.current.priority.to_i diff --git a/temp_file/Gemfile b/temp_file/Gemfile index a20381f..e6c71fc 100644 --- a/temp_file/Gemfile +++ b/temp_file/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -#fix update manager error!!!!!!!! +#update all site!!!!!!!! #social gems gem "omniauth-google-oauth2" diff --git a/temp_file/app/controllers/admin/sites_controller.rb b/temp_file/app/controllers/admin/sites_controller.rb index bf10379..03c6d4b 100644 --- a/temp_file/app/controllers/admin/sites_controller.rb +++ b/temp_file/app/controllers/admin/sites_controller.rb @@ -184,7 +184,7 @@ class Admin::SitesController < OrbitAdminController if %x[git config user.email].empty? %x[git config --global user.email "orbit@rulingcom.com"] end - 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_custom} && #{git_restore} && #{git_add_except_public}&& #{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_custom} && #{git_restore} && #{git_add_except_public}&& #{git} commit -m complete_#{type}_#{time_now} && cp -rf public/assets public/assets_back && rm -rf public/assets")} mul.update_attributes(status: 'finish') end end