auto install ruby 2.1.10 when using 2.1.3
This commit is contained in:
parent
4274ee1a82
commit
7cc4f19679
|
@ -115,6 +115,13 @@ if old_gemfile_text != new_gemfile_text
|
||||||
if watch_dog.scan("auto_reopen_#{dir_name}").count != 0
|
if watch_dog.scan("auto_reopen_#{dir_name}").count != 0
|
||||||
Bundler.with_clean_env{%x[screen -ls | grep auto_reopen_#{dir_name} | cut -d. -f1 | awk '{print $1}' | xargs kill]}
|
Bundler.with_clean_env{%x[screen -ls | grep auto_reopen_#{dir_name} | cut -d. -f1 | awk '{print $1}' | xargs kill]}
|
||||||
end
|
end
|
||||||
|
if %x[ruby -v].scan(/\d\.\d\.\d/)[0] == '2.1.3'
|
||||||
|
install_cmd = 'rvm install 2.1.10 && rvm use default 2.1.10'
|
||||||
|
use_cmd = 'source ~/.rvm/scripts/rvm && rvm use 2.1.10 --default;'
|
||||||
|
else
|
||||||
|
install_cmd = ''
|
||||||
|
use_cmd = ''
|
||||||
|
end
|
||||||
if files.count ==0
|
if files.count ==0
|
||||||
command1 = "gem install bundler -v 1.17.3 ; bundle install --force ; bundle update"
|
command1 = "gem install bundler -v 1.17.3 ; bundle install --force ; bundle update"
|
||||||
else
|
else
|
||||||
|
@ -130,7 +137,7 @@ if old_gemfile_text != new_gemfile_text
|
||||||
f.puts exist_str
|
f.puts exist_str
|
||||||
}
|
}
|
||||||
end
|
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 = "#{install_cmd} ; #{command1} ; #{command2} #{command3} #{command4} "
|
||||||
watch_dog_cmd = "watch -n 30 \"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 = File.new(File.join(env_pwd,'bundle_update_background.sh'),"w")
|
||||||
#file.write(all_command)
|
#file.write(all_command)
|
||||||
|
@ -140,7 +147,7 @@ if old_gemfile_text != new_gemfile_text
|
||||||
Bundler.with_clean_env do
|
Bundler.with_clean_env do
|
||||||
puts env_pwd
|
puts env_pwd
|
||||||
puts mode
|
puts mode
|
||||||
exec("cd #{env_pwd} && env -i HOME=\"$HOME\" bash -l -c \"#{all_command}\" ; screen -d -m -S auto_reopen_#{dir_name} #{watch_dog_cmd} ")
|
exec("cd #{env_pwd} && env -i HOME=\"$HOME\" bash -l -c \"#{all_command}\" ;screen -d -m -S auto_reopen_#{dir_name} bash -c \"#{use_cmd} kill -s TERM `cat tmp/pids/unicorn.pid` ; unset UNICORN_FD ; bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode};#{watch_dog_cmd}\" ")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
now_priority = Thread.current.priority.to_i
|
now_priority = Thread.current.priority.to_i
|
||||||
|
|
Loading…
Reference in New Issue