diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-15 10:24:30 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-15 20:14:21 +0200 |
commit | ed18e04bb3d921d14f1bfb9adf7e0a4ad4dfc0b2 (patch) | |
tree | 118ae678c92aae63e89ebbb62db55c5e6bb02674 /lib/tasks/ci | |
parent | b87ca7500f174cc9a4e90b262b02aa9bf695fbee (diff) | |
download | gitlab-ce-ed18e04bb3d921d14f1bfb9adf7e0a4ad4dfc0b2.tar.gz |
Cleanup CI backup => migrate with GitLab
Diffstat (limited to 'lib/tasks/ci')
-rw-r--r-- | lib/tasks/ci/backup.rake | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/lib/tasks/ci/backup.rake b/lib/tasks/ci/backup.rake deleted file mode 100644 index 1cb2e43f875..00000000000 --- a/lib/tasks/ci/backup.rake +++ /dev/null @@ -1,62 +0,0 @@ -namespace :ci do - namespace :backup do - - desc "GITLAB | Create a backup of the GitLab CI database" - task create: :environment do - configure_cron_mode - - $progress.puts "Dumping database ... ".blue - Ci::Backup::Database.new.dump - $progress.puts "done".green - - $progress.puts "Dumping builds ... ".blue - Ci::Backup::Builds.new.dump - $progress.puts "done".green - - backup = Ci::Backup::Manager.new - backup.pack - backup.cleanup - backup.remove_old - end - - desc "GITLAB | Restore a previously created backup" - task restore: :environment do - configure_cron_mode - - backup = Ci::Backup::Manager.new - backup.unpack - - $progress.puts "Restoring database ... ".blue - Ci::Backup::Database.new.restore - $progress.puts "done".green - - $progress.puts "Restoring builds ... ".blue - Ci::Backup::Builds.new.restore - $progress.puts "done".green - - backup.cleanup - end - - def configure_cron_mode - if ENV['CRON'] - # We need an object we can say 'puts' and 'print' to; let's use a - # StringIO. - require 'stringio' - $progress = StringIO.new - else - $progress = $stdout - end - end - end - - # Disable colors for CRON - unless STDOUT.isatty - module Colored - extend self - - def colorize(string, options={}) - string - end - end - end -end |