auto change git remote url

This commit is contained in:
chiu 2020-02-16 11:17:52 +08:00
parent d85331887a
commit 02c1b2685c
3 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,12 @@ puts 'editing files for sassc'
new_gemfile_text = File.read(app_path+'/temp_file/Gemfile') new_gemfile_text = File.read(app_path+'/temp_file/Gemfile')
old_gemfile_text = File.read(ENV['PWD']+'/Gemfile') old_gemfile_text = File.read(ENV['PWD']+'/Gemfile')
check_texts = ['@import "../../bootstrap/variables";',".response-content {\n position: relative;\n\n @media (min-width: $screen-sm) {\n width: 100%;\n }\n\n @media (min-width: $screen-md) {\n width: 970px;\n }\n\n @media (min-width: $screen-lg) {\n width: 1100px;\n }\n}\n"] check_texts = ['@import "../../bootstrap/variables";',".response-content {\n position: relative;\n\n @media (min-width: $screen-sm) {\n width: 100%;\n }\n\n @media (min-width: $screen-md) {\n width: 970px;\n }\n\n @media (min-width: $screen-lg) {\n width: 1100px;\n }\n}\n"]
git_url = %x[cd '#{ENV['PWD']}' && git config --get remote.origin.url].sub("\n",'')
git_remote = %x[cd '#{ENV['PWD']}' && git remote].sub("\n",'')
if git_url != 'https://ruling.digital/git'
puts 'changing remote url'
system("cd #{ENV['PWD']} && git remote set-url #{git_remote} https://ruling.digital/git")
end
all_template.each do |folder| all_template.each do |folder|
if !folder.include?('mobile') if !folder.include?('mobile')
begin begin

View File

@ -1,5 +1,5 @@
source 'https://rubygems.org' source 'https://rubygems.org'
#test!!!!!!!! #test1!!!!!!!!
#social gems #social gems
gem "omniauth-google-oauth2" gem "omniauth-google-oauth2"

View File

@ -140,7 +140,10 @@ class Admin::PlaygroundController < OrbitAdminController
end end
mul.status['alive'] = false mul.status['alive'] = false
mul.save mul.save
Bundler.with_clean_env{system("kill -s USR2 `cat tmp/pids/unicorn.pid`")} if command == 'bundle update'
system('sleep 2')
Bundler.with_clean_env{system("kill -s USR2 `cat tmp/pids/unicorn.pid`")}
end
end end
rescue => e rescue => e
mul.status['alive'] = false mul.status['alive'] = false