chef_backup 0.0.1.dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.kitchen.yml +30 -0
  4. data/.rubocop.yml +17 -0
  5. data/.travis.yml +6 -0
  6. data/Gemfile +4 -0
  7. data/Guardfile +22 -0
  8. data/LICENSE +13 -0
  9. data/README.md +33 -0
  10. data/Rakefile +44 -0
  11. data/chef_backup.gemspec +33 -0
  12. data/lib/chef_backup.rb +12 -0
  13. data/lib/chef_backup/config.rb +57 -0
  14. data/lib/chef_backup/data_map.rb +44 -0
  15. data/lib/chef_backup/exceptions.rb +12 -0
  16. data/lib/chef_backup/helpers.rb +159 -0
  17. data/lib/chef_backup/logger.rb +39 -0
  18. data/lib/chef_backup/runner.rb +136 -0
  19. data/lib/chef_backup/strategy.rb +29 -0
  20. data/lib/chef_backup/strategy/backup/custom.rb +7 -0
  21. data/lib/chef_backup/strategy/backup/ebs.rb +28 -0
  22. data/lib/chef_backup/strategy/backup/lvm.rb +42 -0
  23. data/lib/chef_backup/strategy/backup/object.rb +29 -0
  24. data/lib/chef_backup/strategy/backup/tar.rb +165 -0
  25. data/lib/chef_backup/strategy/restore/custom.rb +0 -0
  26. data/lib/chef_backup/strategy/restore/ebs.rb +0 -0
  27. data/lib/chef_backup/strategy/restore/lvm.rb +0 -0
  28. data/lib/chef_backup/strategy/restore/object.rb +0 -0
  29. data/lib/chef_backup/strategy/restore/tar.rb +125 -0
  30. data/lib/chef_backup/version.rb +4 -0
  31. data/spec/fixtures/chef-server-running.json +584 -0
  32. data/spec/spec_helper.rb +103 -0
  33. data/spec/unit/data_map_spec.rb +59 -0
  34. data/spec/unit/helpers_spec.rb +88 -0
  35. data/spec/unit/runner_spec.rb +185 -0
  36. data/spec/unit/shared_examples/helpers.rb +20 -0
  37. data/spec/unit/strategy/backup/lvm_spec.rb +0 -0
  38. data/spec/unit/strategy/backup/shared_examples/backup.rb +74 -0
  39. data/spec/unit/strategy/backup/tar_spec.rb +280 -0
  40. data/spec/unit/strategy/restore/lvm_spec.rb +0 -0
  41. data/spec/unit/strategy/restore/shared_examples/restore.rb +84 -0
  42. data/spec/unit/strategy/restore/tar_spec.rb +238 -0
  43. data/spec/unit/strategy_spec.rb +36 -0
  44. metadata +253 -0
@@ -0,0 +1,36 @@
1
+ require 'spec_helper'
2
+
3
+ describe ChefBackup::Strategy do
4
+ before do
5
+ # Backup Tester
6
+ class ChefBackup::Strategy::TestBackup
7
+ def initialize(_p = {})
8
+ end
9
+ end
10
+
11
+ # Restore Tester
12
+ class ChefBackup::Strategy::TestRestore
13
+ def initialize(_p = {})
14
+ end
15
+ end
16
+ end
17
+
18
+ after do
19
+ described_class.send(:remove_const, :TestBackup)
20
+ described_class.send(:remove_const, :TestRestore)
21
+ end
22
+
23
+ describe '.backup' do
24
+ it 'it returns a backup strategy' do
25
+ expect(described_class.backup('test'))
26
+ .to be_an(ChefBackup::Strategy::TestBackup)
27
+ end
28
+ end
29
+
30
+ describe '.restore' do
31
+ it 'it returns a restore strategy' do
32
+ expect(described_class.restore('test', '/some/backup.tgz'))
33
+ .to be_an(ChefBackup::Strategy::TestRestore)
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,253 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chef_backup
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.dev.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Cragun
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: di-ruby-lvm
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: mixlib-shellout
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: highline
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: chef
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-rescue
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: '0.28'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: '0.28'
153
+ - !ruby/object:Gem::Dependency
154
+ name: simplecov
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: A library to backup an Enterprise Chef server
168
+ email:
169
+ - me@ryan.ec
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - ".gitignore"
175
+ - ".kitchen.yml"
176
+ - ".rubocop.yml"
177
+ - ".travis.yml"
178
+ - Gemfile
179
+ - Guardfile
180
+ - LICENSE
181
+ - README.md
182
+ - Rakefile
183
+ - chef_backup.gemspec
184
+ - lib/chef_backup.rb
185
+ - lib/chef_backup/config.rb
186
+ - lib/chef_backup/data_map.rb
187
+ - lib/chef_backup/exceptions.rb
188
+ - lib/chef_backup/helpers.rb
189
+ - lib/chef_backup/logger.rb
190
+ - lib/chef_backup/runner.rb
191
+ - lib/chef_backup/strategy.rb
192
+ - lib/chef_backup/strategy/backup/custom.rb
193
+ - lib/chef_backup/strategy/backup/ebs.rb
194
+ - lib/chef_backup/strategy/backup/lvm.rb
195
+ - lib/chef_backup/strategy/backup/object.rb
196
+ - lib/chef_backup/strategy/backup/tar.rb
197
+ - lib/chef_backup/strategy/restore/custom.rb
198
+ - lib/chef_backup/strategy/restore/ebs.rb
199
+ - lib/chef_backup/strategy/restore/lvm.rb
200
+ - lib/chef_backup/strategy/restore/object.rb
201
+ - lib/chef_backup/strategy/restore/tar.rb
202
+ - lib/chef_backup/version.rb
203
+ - spec/fixtures/chef-server-running.json
204
+ - spec/spec_helper.rb
205
+ - spec/unit/data_map_spec.rb
206
+ - spec/unit/helpers_spec.rb
207
+ - spec/unit/runner_spec.rb
208
+ - spec/unit/shared_examples/helpers.rb
209
+ - spec/unit/strategy/backup/lvm_spec.rb
210
+ - spec/unit/strategy/backup/shared_examples/backup.rb
211
+ - spec/unit/strategy/backup/tar_spec.rb
212
+ - spec/unit/strategy/restore/lvm_spec.rb
213
+ - spec/unit/strategy/restore/shared_examples/restore.rb
214
+ - spec/unit/strategy/restore/tar_spec.rb
215
+ - spec/unit/strategy_spec.rb
216
+ homepage: https://github.com/ryancragun/chef_backup
217
+ licenses:
218
+ - Apachev2
219
+ metadata: {}
220
+ post_install_message:
221
+ rdoc_options: []
222
+ require_paths:
223
+ - lib
224
+ required_ruby_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ required_rubygems_version: !ruby/object:Gem::Requirement
230
+ requirements:
231
+ - - ">"
232
+ - !ruby/object:Gem::Version
233
+ version: 1.3.1
234
+ requirements: []
235
+ rubyforge_project:
236
+ rubygems_version: 2.2.2
237
+ signing_key:
238
+ specification_version: 4
239
+ summary: A library to backup an Enterprise Chef server
240
+ test_files:
241
+ - spec/fixtures/chef-server-running.json
242
+ - spec/spec_helper.rb
243
+ - spec/unit/data_map_spec.rb
244
+ - spec/unit/helpers_spec.rb
245
+ - spec/unit/runner_spec.rb
246
+ - spec/unit/shared_examples/helpers.rb
247
+ - spec/unit/strategy/backup/lvm_spec.rb
248
+ - spec/unit/strategy/backup/shared_examples/backup.rb
249
+ - spec/unit/strategy/backup/tar_spec.rb
250
+ - spec/unit/strategy/restore/lvm_spec.rb
251
+ - spec/unit/strategy/restore/shared_examples/restore.rb
252
+ - spec/unit/strategy/restore/tar_spec.rb
253
+ - spec/unit/strategy_spec.rb