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
|
|
|
|
scope.find_each do |project|
|
2016-06-22 17:04:51 -04:00
|
|
|
base = File.join(project.repository_storage_path, project.path_with_namespace)
|
2015-09-25 11:12:41 -04:00
|
|
|
puts base + '.git'
|
|
|
|
puts base + '.wiki.git'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|