gitlabhq/lib/tasks/gitlab/gitolite_rebuild.rake

28 lines
821 B
Ruby
Raw Permalink Normal View History

2012-04-04 00:02:54 +02:00
namespace :gitlab do
namespace :gitolite do
desc "GITLAB | Rebuild each project in Gitolite config"
2012-09-26 13:18:10 +02:00
task :update_repos => :environment do
warn_user_is_not_gitlab
puts "Rebuilding projects ... "
2012-04-04 00:02:54 +02:00
Project.find_each(:batch_size => 100) do |project|
puts "#{project.name_with_namespace.yellow} ... "
2012-04-04 00:02:54 +02:00
project.update_repository
puts "... #{"done".green}"
2012-04-04 00:02:54 +02:00
end
end
desc "GITLAB | Rebuild each user key in Gitolite config"
2012-04-04 00:02:54 +02:00
task :update_keys => :environment do
warn_user_is_not_gitlab
puts "Rebuilding keys ... "
2012-04-04 00:02:54 +02:00
Key.find_each(:batch_size => 100) do |key|
puts "#{key.identifier.yellow} ... "
Gitlab::Gitolite.new.set_key(key.identifier, key.key, key.projects)
puts "... #{"done".green}"
2012-04-04 00:02:54 +02:00
end
end
end
end