Commit 64e34cb9 authored by nmilojevic1's avatar nmilojevic1

Add Gitlab version and revision to export

parent 42d440d5
...@@ -50,6 +50,14 @@ module Gitlab ...@@ -50,6 +50,14 @@ module Gitlab
'VERSION' 'VERSION'
end end
def gitlab_version_filename
'GITLAB_VERSION'
end
def gitlab_revision_filename
'GITLAB_REVISION'
end
def export_filename(exportable:) def export_filename(exportable:)
basename = "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_#{exportable.full_path.tr('/', '_')}" basename = "#{Time.now.strftime('%Y-%m-%d_%H-%M-%3N')}_#{exportable.full_path.tr('/', '_')}"
......
...@@ -13,6 +13,8 @@ module Gitlab ...@@ -13,6 +13,8 @@ module Gitlab
mkdir_p(@shared.export_path) mkdir_p(@shared.export_path)
File.write(version_file, Gitlab::ImportExport.version, mode: 'w') File.write(version_file, Gitlab::ImportExport.version, mode: 'w')
File.write(gitlab_version_file, Gitlab::VERSION, mode: 'w')
File.write(gitlab_revision_file, Gitlab.revision, mode: 'w')
rescue => e rescue => e
@shared.error(e) @shared.error(e)
false false
...@@ -20,6 +22,14 @@ module Gitlab ...@@ -20,6 +22,14 @@ module Gitlab
private private
def gitlab_version_file
File.join(@shared.export_path, Gitlab::ImportExport.gitlab_version_filename)
end
def gitlab_revision_file
File.join(@shared.export_path, Gitlab::ImportExport.gitlab_revision_filename)
end
def version_file def version_file
File.join(@shared.export_path, Gitlab::ImportExport.version_filename) File.join(@shared.export_path, Gitlab::ImportExport.version_filename)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment