2015-09-25 11:12:41 -04:00
|
|
|
namespace :gitlab do
|
|
|
|
task list_repos: :environment do
|
|
|
|
scope = Project
|
|
|
|
if ENV['SINCE']
|
|
|
|
date = Time.parse(ENV['SINCE'])
|
2015-12-08 10:06:06 -05:00
|
|
|
warn "Listing repositories with activity or changes since #{date}"
|
|
|
|
project_ids = Project.where('last_activity_at > ? OR updated_at > ?', date, date).pluck(:id).sort
|
|
|
|
namespace_ids = Namespace.where(['updated_at > ?', date]).pluck(:id).sort
|
|
|
|
scope = scope.where('id IN (?) OR namespace_id in (?)', project_ids, namespace_ids)
|
2015-09-25 11:12:41 -04:00
|
|
|
end
|
2018-01-11 11:34:01 -05:00
|
|
|
|
2015-09-25 11:12:41 -04:00
|
|
|
scope.find_each do |project|
|
2018-04-13 06:57:19 -04:00
|
|
|
puts project.repository.path_to_repo
|
|
|
|
puts project.wiki.repository.path_to_repo
|
2015-09-25 11:12:41 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|