-
Notifications
You must be signed in to change notification settings - Fork 18
/
backup.rb
26 lines (24 loc) · 1.44 KB
/
backup.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set_default(:backup_postgres_socket_path, "/var/run/postgres")
set_default(:backup_encryption_password) { Capistrano::CLI.password_prompt "Choose an encryption password: " }
set_default(:backup_backup_server_pass) { Capistrano::CLI.password_prompt "Choose an encryption password: " }
set_default(:backup_backup_server_host) { Capistrano::CLI.password_prompt "What is your backup server's hostname? " }
set_default(:backup_backup_server_user) { Capistrano::CLI.password_prompt "What is your backup server's username? " }
set_default(:backup_backup_server_path) { Capistrano::CLI.password_prompt "What is the backup path on your backup server? " }
set_default(:backup_rsync_push_directories) { ["#{shared_path}/system"] }
set_default(:backup_archive_daily_folders) { [] }
set_default(:backup_archive_weekly_folders) { ["#{shared_path}/config"] }
namespace :backup do
desc "Install the backup gem."
task :install do
run "mkdir #{shared_path}/config/models"
template "backup/model.rb.erb", "#{shared_path}/config/models/backup.rb"
template "backup/config.rb.erb", "#{shared_path}/config/config.rb"
template "backup/backup.yml.erb", "#{shared_path}/config/backup.yml"
end
after "deploy:install", "backup:install"
desc "Symlink the backup.yml file to the current release"
task :symlink, roles: :app do
run "ln -nfs #{shared_path}/config/backup.yml #{release_path}/config/backup.yml"
end
after "deploy:finalize_update", "backup:symlink"
end