Welcome to mirror list, hosted at ThFree Co, Russian Federation.

archive_repository_service.rb « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8823f6fdc6737b6f96c1f5676da7a8074632e6fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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