diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-11-18 15:01:35 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-11-18 15:01:35 +0300 |
commit | f5e3d93c28ff9e1a7e0ba9bddbbc242709f0fa8b (patch) | |
tree | 76f7452a88c713bf496faece2c26c93fec3460e9 /lib/backup/manager.rb | |
parent | 3b1f68e4b91d030fb3304409d958aa7e8dc7eac2 (diff) |
Check which folders and archives should be packed before passing to tar command.
Diffstat (limited to 'lib/backup/manager.rb')
-rw-r--r-- | lib/backup/manager.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index 9e15d5411a1..69922eb66ea 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -150,17 +150,15 @@ module Backup private def backup_contents - folders_to_backup + ["uploads.tar.gz", "builds.tar.gz", "artifacts.tar.gz", "backup_information.yml"] + folders_to_backup + archives_to_backup + ["backup_information.yml"] end - def folders_to_backup - folders = %w{repositories db} - - if ENV["SKIP"] - return folders.reject{ |folder| ENV["SKIP"].include?(folder) } - end + def archives_to_backup + %w{uploads builds artifacts}.map{ |name| (name + ".tar.gz") unless skipped?(name) }.compact + end - folders + def folders_to_backup + %w{repositories db}.map{ |name| name unless skipped?(name) }.compact end def settings |