mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 13:16:09 +10:00
Export project functionality This is a MR for the export functionality of https://gitlab.com/gitlab-org/gitlab-ce/issues/3050, which adds the ability to export single projects. - [x] members - DB data - [x] issues - [x] issue comments - [x] merge requests - [x] merge request diff - [x] merge request comments - [x] labels - [x] milestones - [x] snippets - [x] releases - [x] events - [x] commit statuses - [x] CI builds - File system data - [x] Git repository - [x] wiki - [x] uploads - [ ] ~~CI build traces~~ - [ ] ~~CI build artifacts~~ - [ ] ~~LFS objects~~ - DB configuration - [x] services - [x] web hooks - [x] protected branches - [x] deploy keys - [x] CI variables - [x] CI triggers See merge request !3114
37 lines
817 B
Ruby
37 lines
817 B
Ruby
module Gitlab
|
|
module ImportExport
|
|
class VersionChecker
|
|
|
|
def self.check!(*args)
|
|
new(*args).check!
|
|
end
|
|
|
|
def initialize(shared:)
|
|
@shared = shared
|
|
end
|
|
|
|
def check!
|
|
version = File.open(version_file, &:readline)
|
|
verify_version!(version)
|
|
rescue => e
|
|
@shared.error(e)
|
|
false
|
|
end
|
|
|
|
private
|
|
|
|
def version_file
|
|
File.join(@shared.export_path, Gitlab::ImportExport.version_filename)
|
|
end
|
|
|
|
def verify_version!(version)
|
|
if Gem::Version.new(version) > Gem::Version.new(Gitlab::ImportExport.version)
|
|
raise Gitlab::ImportExport::Error("Import version mismatch: Required <= #{Gitlab::ImportExport.version} but was #{version}")
|
|
else
|
|
true
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|