mina-data_sync 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aea729ca7c78ba1b367ef5577e48d71f21ec18c5
4
- data.tar.gz: 8cf28983bfeb48f3ade7d15614d2cb05fafbc5b0
3
+ metadata.gz: 60554b56af0d16d78d4dcbc945ba88a0fb6e8337
4
+ data.tar.gz: 14934e0d27f65e374767886933835d9afcb07204
5
5
  SHA512:
6
- metadata.gz: d3e5db27b3ca676040f65a61e50b83369335b608065d9125d48bfdf8bd5d8cef28c2e0b5653512c3c6e28bd0f45590ed960a785e043bb5738774b7d4a485325c
7
- data.tar.gz: 65c81db2cb9be006460d5bb7f4380243bd9df08e463d67658c2fc9f356beba144063d86286abefa0a9630c3a7be03cd9c49ecc46e3b816f65429971cc11f60e5
6
+ metadata.gz: 948f5e338c04af9b10d4efd00b4196aaa497bd6df193153acbfdd6adb1d9897f7c6462a1b17bc5ace878b4714996a19e1eefb9a0734d027b819326589c3e6706
7
+ data.tar.gz: f0bcf4832442ef63719d5e3d880b7c7a13d8739d9b03196646cc096b342b7e8d1a19f10b157a4dd963686dc56ecce41c88fbb0a710d4c8897788514a4a0af2cc
data/README.md CHANGED
@@ -1,13 +1,19 @@
1
1
  # Mina::DataSync
2
2
 
3
- TODO: Write a gem description
3
+ You can sync your production and local database
4
+
5
+ ## Requirements
6
+
7
+ * `rsync`
8
+ * `mina` (Duh)
4
9
 
5
10
  ## Installation
6
11
 
7
12
  Add this line to your application's Gemfile:
8
13
 
9
14
  ```ruby
10
- gem 'mina-data_sync'
15
+ gem 'mina', require: false
16
+ gem 'mina-data_sync', require: false
11
17
  ```
12
18
 
13
19
  And then execute:
@@ -17,10 +23,31 @@ And then execute:
17
23
  Or install it yourself as:
18
24
 
19
25
  $ gem install mina-data_sync
26
+
27
+ Require it in your deploy script:
28
+
29
+ ```ruby
30
+ # config/deploy.rb
31
+ require 'mina/data_sync'
32
+ ```
20
33
 
21
34
  ## Usage
22
35
 
23
- TODO: Write usage instructions here
36
+ ```ruby
37
+ mina data_sync:pull # pulls remote to local
38
+ mina data_sync:push # pushes local to remote
39
+ ```
40
+
41
+ ## Configruation
42
+
43
+ configurable variables with defaults
44
+ ```ruby
45
+ set :database_path, "config/database.yml"
46
+ set :remote_backup_path, 'tmp'
47
+ set :local_backup_path, -> { ENV['DATA_SYNC_BACKUP_PATH'] || 'tmp' }
48
+ # if false will only make a dump and copy it without doing restore
49
+ set :restore_data, -> { ENV['restore'] || 'true' }
50
+ ```
24
51
 
25
52
  ## Contributing
26
53
 
@@ -1,16 +1,17 @@
1
1
  namespace :data_sync do
2
- set :term_mode, :pretty
3
-
4
2
  task setup_sync: :environment do
5
3
  read_conf(database_path, rails_env)
6
4
  end
7
5
 
8
6
  task pull: :setup_sync do
7
+ set :term_mode, :pretty
8
+
9
9
  queue "echo '-----> Dumping database'"
10
10
  queue "cd #{deploy_to}/#{current_path}"
11
11
  queue "#{CONF}"
12
12
  queue "ARGS=$(conf #{database_path} #{rails_env})"
13
13
  queue "mkdir -p #{remote_backup_path}"
14
+ queue! "echo $ARGS"
14
15
  queue! "#{dump} $ARGS #{options} > #{remote_backup_path}/#{backup_file}"
15
16
 
16
17
  to :after_hook do
@@ -27,6 +28,8 @@ namespace :data_sync do
27
28
  end
28
29
 
29
30
  task push: :setup_sync do
31
+ set :term_mode, :pretty
32
+
30
33
  to :before_hook do
31
34
  queue "echo '-----> Dumping database'"
32
35
  queue "#{CONF}"
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module DataSync
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-data_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,3 +113,4 @@ signing_key:
113
113
  specification_version: 4
114
114
  summary: Summary
115
115
  test_files: []
116
+ has_rdoc: