diff options
-rw-r--r-- | lib/tasks/gitlab/gitolite_rebuild.rake | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/tasks/gitlab/gitolite_rebuild.rake b/lib/tasks/gitlab/gitolite_rebuild.rake index fce10eb5b69..af2a2127ee2 100644 --- a/lib/tasks/gitlab/gitolite_rebuild.rake +++ b/lib/tasks/gitlab/gitolite_rebuild.rake @@ -1,24 +1,27 @@ namespace :gitlab do namespace :gitolite do - desc "GITLAB | Rebuild each project at gitolite config" + desc "GITLAB | Rebuild each project in Gitolite config" task :update_repos => :environment do - puts "Starting Projects" + warn_user_is_not_gitlab + + puts "Rebuilding projects ... " Project.find_each(:batch_size => 100) do |project| - puts "\n=== #{project.name}" + puts "#{project.name_with_namespace.yellow} ... " project.update_repository - puts + puts "... #{"done".green}" end - puts "Done with projects" end - desc "GITLAB | Rebuild each key at gitolite config" + desc "GITLAB | Rebuild each user key in Gitolite config" task :update_keys => :environment do - puts "Starting Key" + warn_user_is_not_gitlab + + puts "Rebuilding keys ... " Key.find_each(:batch_size => 100) do |key| + puts "#{key.identifier.yellow} ... " Gitlab::Gitolite.new.set_key(key.identifier, key.key, key.projects) - print '.' + puts "... #{"done".green}" end - puts "Done with keys" end end end |