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