Mina::DataSync
You can sync your production and local database
Requirements
rsyncmina(Duh)
Installation
Add this line to your application's Gemfile:
gem 'mina', require: false
gem 'mina-data_sync', require: false
And then execute:
$ bundle
Or install it yourself as:
$ gem install mina-data_sync
Require it in your deploy script:
# config/deploy.rb
require 'mina/data_sync'
Usage
mina data_sync:pull # pulls remote to local
mina data_sync:push # pushes local to remote
Configruation
configurable variables with defaults
set :database_path, "config/database.yml"
set :remote_backup_path, 'tmp'
set :local_backup_path, -> { ENV['DATA_SYNC_BACKUP_PATH'] || 'tmp' }
set :restore_data, -> { ENV['restore'] || 'true' } # if false will not restore backup
set :dump_data, -> { ENV['dump'] || 'true' } # if false will not dump and copy backup
Contributing
- Fork it ( https://github.com/[my-github-username]/mina-data_sync/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request