Commit db75883a authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '118640_add_gitlab_version_and_revision_to_export' into 'master'

Add Gitlab version and revision to export

See merge request gitlab-org/gitlab!22108
parents fcd1e422 d5cfad95
---
title: Add Gitlab version and revision to export
merge_request: 22108
author:
type: added
...@@ -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