diff --git a/lib/tasks/gitlab_new.rake b/lib/tasks/gitlab_new.rake new file mode 100644 index 00000000..fd6e0c56 --- /dev/null +++ b/lib/tasks/gitlab_new.rake @@ -0,0 +1,31 @@ +namespace :gitlab do + task :myshixun_newgit => :environment do + g = Gitlab.client + myshixuns = Myshixun.where("repo_name is null") + myshixuns.find_each do |myshixun| + begin + puts myshixun.id + repo_name = g.project(myshixun.gpid).path_with_namespace + puts repo_name + myshixun.update_column(:repo_name, repo_name) + rescue Exception => e + Rails.logger.error("e.message") + end + end + end + + task :shixun_newgit => :environment do + g = Gitlab.client + shixuns = Shixun.where("repo_name is null") + shixuns.find_each do |shixun| + begin + puts shixun.id + repo_name = g.project(shixun.gpid).path_with_namespace + puts shixun.id + shixun.update_column(:repo_name, repo_name) + rescue Exception => e + Rails.logger.error("e.message") + end + end + end +end