OSDN Git Service

fixed broken gitlab version determination during backup
authorAngus MacArthur <amacarthur@blackberry.com>
Tue, 23 Apr 2013 19:30:32 +0000 (15:30 -0400)
committerAngus MacArthur <amacarthur@blackberry.com>
Tue, 23 Apr 2013 20:14:13 +0000 (16:14 -0400)
If the backup directory is not sub the gitlab install directory,
then the git rev-parse call will fail.

lib/tasks/gitlab/backup.rake

index f98aa54..9f28de5 100644 (file)
@@ -11,8 +11,6 @@ namespace :gitlab do
       Rake::Task["gitlab:backup:repo:create"].invoke
       Rake::Task["gitlab:backup:uploads:create"].invoke
 
-      Dir.chdir(Gitlab.config.backup.path)
-
       # saving additional informations
       s = {}
       s[:db_version]         = "#{ActiveRecord::Migrator.current_version}"
@@ -20,6 +18,8 @@ namespace :gitlab do
       s[:gitlab_version]     = %x{git rev-parse HEAD}.gsub(/\n/,"")
       s[:tar_version]        = %x{tar --version | head -1}.gsub(/\n/,"")
 
+      Dir.chdir(Gitlab.config.backup.path)
+
       File.open("#{Gitlab.config.backup.path}/backup_information.yml", "w+") do |file|
         file << s.to_yaml.gsub(/^---\n/,'')
       end