dev_partners
jingquan huang 6 years ago
parent 41a1795b32
commit 593ee71e79

@ -150,12 +150,15 @@ class WelcomeController < ApplicationController
shixun.update_column(:git_url, g.project(shixun.gpid).path_with_namespace) shixun.update_column(:git_url, g.project(shixun.gpid).path_with_namespace)
local_git_path = local_shixun.local_giturl.split('/').last if local_shixun.local_giturl.present? local_git_path = local_shixun.local_giturl.split('/').last if local_shixun.local_giturl.present?
new_giturl = "http://educoder:xinhu1ji2qu3@"+g.project(shixun.gpid).http_url_to_repo.split('//').last new_giturl = "http://educoder:xinhu1ji2qu3@"+g.project(shixun.gpid).http_url_to_repo.split('//').last
system("cd tmp/repositories/#{local_git_path}") if system("cd tmp/repositories/#{local_git_path};")
system("git remote remove origin") system("git remote remove origin")
system("git remote add origin #{new_giturl}") system("git remote add origin #{new_giturl}")
system("git add .") system("git add .")
system("git commit -m '..'") system("git commit -m '..'")
system("git push origin master") system("git push origin master")
end
# http://Hjqreturn:xinhu1ji2qu3@bdgit.educoder.net/Hjqreturn/pgfqe6ch8.git (fetch)
# 同步关卡信息 # 同步关卡信息
local_challenges = LocalChallenge.where(local_shixun_id: local_shixun.id) local_challenges = LocalChallenge.where(local_shixun_id: local_shixun.id)

Loading…
Cancel
Save