|
|
|
@ -9,12 +9,13 @@ namespace :shixun_sync do
|
|
|
|
|
|
|
|
|
|
subject_id = ENV['args'].to_s # 课程id
|
|
|
|
|
puts subject_id
|
|
|
|
|
subject = Subject.find_by(subject_id)
|
|
|
|
|
subject = Subject.find_by(id: subject_id)
|
|
|
|
|
subject.shixuns.try(:each) do |shixun|
|
|
|
|
|
username = shixun.owner.try(:login)
|
|
|
|
|
# new_repo_name = "#{username.try(:strip)}/#{shixun.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}"
|
|
|
|
|
# GitService.fork_repository(repo_path: "#{shixun.try(:repo_name)}.git", fork_repository_path: (new_repo_name + ".git"))
|
|
|
|
|
puts "#############{username}"
|
|
|
|
|
|
|
|
|
|
puts "#############{shixun.id}"
|
|
|
|
|
project_fork(shixun, "#{shixun.try(:repo_name)}.git", username)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|