Skip to content
Snippets Groups Projects
Commit 63b36c92 authored by Kamil Trzciński's avatar Kamil Trzciński
Browse files

Merge branch 'backup-directory-permissions' into 'master'

More export improvements



See merge request !253
parents 6c73ce68 8a342e69
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -30,7 +30,7 @@ module Backup
# default behavior of tar is to talk to a tape device instead of
# stdin/stdout.
system(
*%W(tar -C #{app_builds_dir} -xzf - -- .),
*%W(tar -C #{app_builds_dir} -xzf -),
in: backup_builds_tarball
)
end
Loading
Loading
Loading
Loading
@@ -19,17 +19,16 @@ module Backup
 
# create archive
$progress.print "Creating backup archive: #{tar_file} ... "
orig_umask = File.umask(0077)
if Kernel.system('tar', '-cf', tar_file, *backup_contents)
$progress.puts "done".green
else
puts "creating archive #{tar_file} failed".red
abort 'Backup failed'
end
File.umask(orig_umask)
 
upload(tar_file)
end
File.join(GitlabCi.config.backup.path, tar_file)
end
 
def upload(tar_file)
Loading
Loading
Loading
Loading
@@ -18,9 +18,40 @@ namespace :backup do
$progress.puts "done".green
 
backup = Backup::Manager.new
backup.pack
tar_file = backup.pack
backup.cleanup
backup.remove_old
# Relax backup directory permissions to make the migration easier
File.chmod(0755, GitlabCi.config.backup.path)
$progress.puts "\n\nYour final CI export is in the following file:\n\n"
system(*%W(ls -lh #{tar_file}))
$progress.puts
end
desc "GITLAB | Show database secrets"
task show_secrets: :environment do
configure_cron_mode
$progress.puts <<-EOS
If you are moving to a GitLab installation installed from source, replace the
contents of /home/git/gitlab/config/secrets.yml with the following:
---
production:
db_key_base: #{JSON.dump(GitlabCi::Application.secrets.db_key_base)}
If your GitLab server uses Omnibus packages, add the following line to
/etc/gitlab/gitlab.rb:
gitlab_rails['db_key_base'] = #{GitlabCi::Application.secrets.db_key_base.inspect}
EOS
end
 
desc "GITLAB | Restore a previously created backup"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment