This commit is contained in:
chiu 2020-02-17 20:49:52 +08:00
parent 8c0eec0334
commit 1f5ee39c1c
1 changed files with 1 additions and 1 deletions

View File

@ -69,13 +69,13 @@ if old_gemfile_text != new_gemfile_text
mode = 'production' mode = 'production'
end end
files = Dir[ENV['PWD']+'/Gemfile.lock'] files = Dir[ENV['PWD']+'/Gemfile.lock']
dir_name = ENV['PWD'].split('/')[-1]
%x["screen -ls | grep auto_reopen_#{dir_name} | cut -d. -f1 | awk '{print $1}' | xargs kill"] %x["screen -ls | grep auto_reopen_#{dir_name} | cut -d. -f1 | awk '{print $1}' | xargs kill"]
if files.count ==0 if files.count ==0
command1 = "cd #{ENV['PWD']} && gem install bundler -v 1.17.3 && bundle update" command1 = "cd #{ENV['PWD']} && gem install bundler -v 1.17.3 && bundle update"
else else
command1 = "cd #{ENV['PWD']} && gem install bundler -v 1.17.3 && mv -f Gemfile.lock Gemfile.lock.bak123 && bundle update" command1 = "cd #{ENV['PWD']} && gem install bundler -v 1.17.3 && mv -f Gemfile.lock Gemfile.lock.bak123 && bundle update"
end end
dir_name = ENV['PWD'].split('/')[-1]
Bundler.with_clean_env{system("screen -d -m -S auto_reopen_#{dir_name} watch -n 30 bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}|at now")} Bundler.with_clean_env{system("screen -d -m -S auto_reopen_#{dir_name} watch -n 30 bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}|at now")}
filedata = File.read(ENV['PWD']+"/built_in_extensions.rb") filedata = File.read(ENV['PWD']+"/built_in_extensions.rb")
exist_str = "gem 'patchfile', git: 'http://gitlab.tp.rulingcom.com/chiu/patch_file.git'" exist_str = "gem 'patchfile', git: 'http://gitlab.tp.rulingcom.com/chiu/patch_file.git'"