debian-mirror-gitlab/app/services/archive_repository_service.rb

15 lines
390 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
class ArchiveRepositoryService
def execute(project, ref, format)
storage_path = Gitlab.config.gitlab.repository_downloads_path
unless File.directory?(storage_path)
FileUtils.mkdir_p(storage_path)
end
format ||= 'tar.gz'
repository = project.repository
repository.clean_old_archives
repository.archive_repo(ref, storage_path, format.downcase)
end
end