bibliotech 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d21d1254a3d0b99333eb8478c19ecae2f9fe31d5
4
- data.tar.gz: b5f3e42e6ae588dc19e20108b829cd7a87e5cb25
3
+ metadata.gz: baf643d74df4ae3246259e010a5ec4bcbac3ae96
4
+ data.tar.gz: 0906c68dbda1ec2e7ef14e300cb1ce9ca88665bb
5
5
  SHA512:
6
- metadata.gz: 2fcbbfa05a734b9410c233a6df3af4afaca7021e2423a68ffff73c2d0b6ecc7fefeda68fba14906c55a7de9d4f381ce60b7081e2d82b1e96c1e024456c96eb8e
7
- data.tar.gz: f6100edf98e400cc20ddce4942578191ee09d3a94063e83896e74ea7b85a2b54fb09a31ab0f14a8d3334daf85fa2ed186be67764de94167aad2266e919867253
6
+ metadata.gz: 66002dc0d4e455d86d7441ec737a4666f411bc96434befe6c9d0b077eb6131f82ae6b2a9c4a3348b73f7c902ffd87daa08a9b0465efacb9b779e2376e5da0b28
7
+ data.tar.gz: 4cc25d81f1d5639c99d6d6ff739f35b04aef4200b0ce17adae597665b5398f6013879cba206a47131427105f832d080e9741c06503c208e32cbd94131cefe897
@@ -3,22 +3,19 @@ remote: staging
3
3
 
4
4
  #defaults
5
5
  database_config_file: 'config/database.yml' # this is the default
6
+ backups:
7
+ dir: db_backups
8
+ compress: gzip # [ none, gzip, bzip2, 7zip ]
9
+ prefix: backup
6
10
 
7
11
  production:
8
12
  backups:
9
- dir: db_backups
10
- compress: gzip # [ none, gzip, bzip2, 7zip ]
11
- prefix: backup
12
13
  keep:
13
14
  hourlies: 48
14
15
  dailies: 14
15
16
  weeklies: 8
16
17
  monthlies: all
17
-
18
18
  frequency: hourly
19
- clone:
20
- storage: s3 [ file, ftp, scp ]
21
- target: db_backups # URL
22
19
 
23
20
  database_config_env: production
24
21
 
@@ -41,6 +41,7 @@ module BiblioTech
41
41
  def define
42
42
  in_namespace do
43
43
  namespace :backups do
44
+ desc "Restore from a named DB backup"
44
45
  task :restore, [:name] do |task, args|
45
46
  fail ":name is required" if args[:name].nil?
46
47
  options = { :backups => { :filename => args[:name] } }
@@ -51,25 +52,34 @@ module BiblioTech
51
52
  end
52
53
 
53
54
  task :create, [:prefix] do |task, args|
54
- fail ":prefix is required" if args[:prefix].nil?
55
- app.create_backup( :backups => { :prefix => args[:prefix] } )
55
+ options = {}
56
+ unless args[:prefix].nil?
57
+ options[:backups] = {:prefix => args[:prefix]}
58
+ end
59
+ app.create_backup(options)
56
60
  end
57
61
 
58
62
  task :clean, [:prefix] do |task, args|
59
- fail ":prefix is required" if args[:prefix].nil?
60
- app.prune( :backups => { :prefix => args[:prefix] } )
63
+ options = {}
64
+ unless args[:prefix].nil?
65
+ options[:backups] = {:prefix => args[:prefix]}
66
+ end
67
+ app.prune(options)
61
68
  end
62
69
 
70
+ desc "Run DB backups, including cleaning up the resulting backups"
63
71
  task :perform, [:prefix] => [:create, :clean]
64
72
  end
65
73
 
66
74
  namespace :remote_sync do
75
+ desc "Pull the latest DB dump from the remote server into our local DB"
67
76
  task :down do
68
77
  filename = app.remote_cli(remote, "latest")
69
78
  app.get(remote, filename)
70
79
  app.import(:backups => { :filename => filename})
71
80
  end
72
81
 
82
+ desc "Push the latest local DB dump to the remote server's DB"
73
83
  task :up do
74
84
  filename = app.latest
75
85
  app.send(remote, filename)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliotech
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Dorn
@@ -128,7 +128,7 @@ rdoc_options:
128
128
  - --main
129
129
  - doc/README
130
130
  - --title
131
- - bibliotech-0.2.1 Documentation
131
+ - bibliotech-0.2.2 Documentation
132
132
  require_paths:
133
133
  - lib/
134
134
  required_ruby_version: !ruby/object:Gem::Requirement