gitlab-org--gitlab-foss/app/services/archive_repository_service.rb
Dmitriy Zaporozhets 1d63464c82
Fix repository archive
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-13 21:28:22 +03:00

14 lines
390 B
Ruby

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