chef_backup 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/lib/chef_backup.rb +8 -8
  3. data/lib/chef_backup/config.rb +17 -17
  4. data/lib/chef_backup/data_map.rb +18 -12
  5. data/lib/chef_backup/deep_merge.rb +145 -0
  6. data/lib/chef_backup/helpers.rb +46 -10
  7. data/lib/chef_backup/logger.rb +2 -2
  8. data/lib/chef_backup/mash.rb +226 -0
  9. data/lib/chef_backup/runner.rb +11 -13
  10. data/lib/chef_backup/strategy.rb +10 -10
  11. data/lib/chef_backup/strategy/backup/custom.rb +1 -2
  12. data/lib/chef_backup/strategy/backup/ebs.rb +3 -6
  13. data/lib/chef_backup/strategy/backup/lvm.rb +2 -4
  14. data/lib/chef_backup/strategy/backup/object.rb +2 -4
  15. data/lib/chef_backup/strategy/backup/tar.rb +23 -7
  16. data/lib/chef_backup/strategy/restore/tar.rb +69 -43
  17. data/lib/chef_backup/version.rb +1 -1
  18. metadata +20 -168
  19. data/.gitignore +0 -23
  20. data/.kitchen.yml +0 -30
  21. data/.rubocop.yml +0 -21
  22. data/.travis.yml +0 -6
  23. data/Gemfile +0 -4
  24. data/Guardfile +0 -22
  25. data/README.md +0 -21
  26. data/Rakefile +0 -44
  27. data/chef_backup.gemspec +0 -33
  28. data/spec/fixtures/chef-server-running.json +0 -589
  29. data/spec/spec_helper.rb +0 -98
  30. data/spec/unit/data_map_spec.rb +0 -59
  31. data/spec/unit/helpers_spec.rb +0 -88
  32. data/spec/unit/runner_spec.rb +0 -185
  33. data/spec/unit/shared_examples/helpers.rb +0 -20
  34. data/spec/unit/strategy/backup/lvm_spec.rb +0 -0
  35. data/spec/unit/strategy/backup/shared_examples/backup.rb +0 -92
  36. data/spec/unit/strategy/backup/tar_spec.rb +0 -327
  37. data/spec/unit/strategy/restore/lvm_spec.rb +0 -0
  38. data/spec/unit/strategy/restore/shared_examples/restore.rb +0 -84
  39. data/spec/unit/strategy/restore/tar_spec.rb +0 -255
  40. data/spec/unit/strategy_spec.rb +0 -36
@@ -1,4 +1,4 @@
1
1
  # ChefBackup module
2
2
  module ChefBackup
3
- VERSION = '0.0.1'.freeze
3
+ VERSION = "0.1.0".freeze
4
4
  end
metadata CHANGED
@@ -1,192 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Ryan Cragun
7
+ - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2019-09-24 00:00:00.000000000 Z
12
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
13
  - !ruby/object:Gem::Dependency
28
14
  name: mixlib-shellout
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - ">="
32
18
  - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
19
+ version: '2.0'
20
+ - - "<"
39
21
  - !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'
22
+ version: '4.0'
48
23
  type: :runtime
49
24
  prerelease: false
50
25
  version_requirements: !ruby/object:Gem::Requirement
51
26
  requirements:
52
27
  - - ">="
53
28
  - !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
- - - ">="
29
+ version: '2.0'
30
+ - - "<"
67
31
  - !ruby/object:Gem::Version
68
- version: '0'
32
+ version: '4.0'
69
33
  - !ruby/object:Gem::Dependency
70
- name: bundler
34
+ name: highline
71
35
  requirement: !ruby/object:Gem::Requirement
72
36
  requirements:
73
37
  - - "~>"
74
38
  - !ruby/object:Gem::Version
75
39
  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
40
  - - ">="
137
41
  - !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.37.2
146
- type: :development
42
+ version: 1.6.9
43
+ type: :runtime
147
44
  prerelease: false
148
45
  version_requirements: !ruby/object:Gem::Requirement
149
46
  requirements:
150
47
  - - "~>"
151
48
  - !ruby/object:Gem::Version
152
- version: 0.37.2
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:
49
+ version: '1.6'
164
50
  - - ">="
165
51
  - !ruby/object:Gem::Version
166
- version: '0'
52
+ version: 1.6.9
167
53
  description: A library to backup a Chef Server
168
54
  email:
169
- - me@ryan.ec
55
+ - oss@chef.io
170
56
  executables: []
171
57
  extensions: []
172
58
  extra_rdoc_files: []
173
59
  files:
174
- - ".gitignore"
175
- - ".kitchen.yml"
176
- - ".rubocop.yml"
177
- - ".travis.yml"
178
- - Gemfile
179
- - Guardfile
180
60
  - LICENSE
181
- - README.md
182
- - Rakefile
183
- - chef_backup.gemspec
184
61
  - lib/chef_backup.rb
185
62
  - lib/chef_backup/config.rb
186
63
  - lib/chef_backup/data_map.rb
64
+ - lib/chef_backup/deep_merge.rb
187
65
  - lib/chef_backup/exceptions.rb
188
66
  - lib/chef_backup/helpers.rb
189
67
  - lib/chef_backup/logger.rb
68
+ - lib/chef_backup/mash.rb
190
69
  - lib/chef_backup/runner.rb
191
70
  - lib/chef_backup/strategy.rb
192
71
  - lib/chef_backup/strategy/backup/custom.rb
@@ -200,22 +79,9 @@ files:
200
79
  - lib/chef_backup/strategy/restore/object.rb
201
80
  - lib/chef_backup/strategy/restore/tar.rb
202
81
  - 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
82
  homepage: https://github.com/chef/chef_backup
217
83
  licenses:
218
- - Apachev2
84
+ - Apache-2.0
219
85
  metadata: {}
220
86
  post_install_message:
221
87
  rdoc_options: []
@@ -232,22 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
98
  - !ruby/object:Gem::Version
233
99
  version: '0'
234
100
  requirements: []
235
- rubyforge_project:
236
- rubygems_version: 2.5.1
101
+ rubygems_version: 3.0.3
237
102
  signing_key:
238
103
  specification_version: 4
239
104
  summary: A library to backup a 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
105
+ test_files: []
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
23
- *.sw*
@@ -1,30 +0,0 @@
1
- driver:
2
- name: vagrant
3
- forward_agent: true
4
- customize:
5
- cpus: 2
6
- memory: 2048
7
- synced_folders:
8
- - ['.', '/home/vagrant/chef_backup']
9
- - ['../../opscode/chef_packages/', '/home/vagrant/chef_packages']
10
-
11
- provisioner:
12
- name: chef_zero
13
- require_chef_omnibus: 11.16.4
14
-
15
- platforms:
16
- - name: ubuntu-14.04
17
- run_list: apt::default
18
- - name: ubuntu-12.04
19
- run_list: apt::default
20
- - name: ubuntu-11.04
21
- run_list: apt::default
22
- - name: ubuntu-10.04
23
- run_list: apt::default
24
- - name: centos-5.10
25
- - name: centos-6.5
26
-
27
- suites:
28
- - name: default
29
- attributes:
30
- run_list:
@@ -1,21 +0,0 @@
1
- Style/ClassAndModuleChildren:
2
- Enabled: false
3
- Style/GuardClause:
4
- Enabled: false
5
- Metrics/LineLength:
6
- Max: 120
7
- Metrics/ClassLength:
8
- Max: 200
9
- Metrics/ModuleLength:
10
- Max: 200
11
- Metrics/CyclomaticComplexity:
12
- Max: 10
13
- Metrics/PerceivedComplexity:
14
- Max: 10
15
- Metrics/MethodLength:
16
- Max: 40
17
- Metrics/AbcSize:
18
- Max: 40
19
- AllCops:
20
- Exclude:
21
- - 'Guardfile'
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - "2.1.5"
4
- - "2.2.0"
5
- notifications:
6
- email: false
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in ec_backup.gemspec
4
- gemspec
data/Guardfile DELETED
@@ -1,22 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- # Note: The cmd option is now required due to the increasing number of ways
5
- # rspec may be run, below are examples of the most common uses.
6
- # * bundler: 'bundle exec rspec'
7
- # * bundler binstubs: 'bin/rspec'
8
- # * spring: 'bin/rsspec' (This will use spring if running and you have
9
- # installed the spring binstubs per the docs)
10
- # * zeus: 'zeus rspec' (requires the server to be started separetly)
11
- # * 'just' rspec: 'rspec'
12
- guard :rspec, cmd: 'bundle exec rspec -f doc --color', all_after_pass: true do
13
- watch(%r{^spec/.+/.+_spec\.rb$})
14
- watch(%r{^spec/.+/.+/.+_spec\.rb$})
15
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
16
- watch(%r{^lib/chef_backup/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
17
- watch(%r{^lib/chef_backup/(.+)/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}/#{m[2]}_spec.rb" }
18
- watch(%r{^lib/chef_backup/(.+)/(.+)/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}/#{m[2]}/#{m[3]}_spec.rb" }
19
- watch('spec/spec_helper.rb') { "spec" }
20
- end
21
-
22
- notification :tmux
data/README.md DELETED
@@ -1,21 +0,0 @@
1
- # ChefBackup
2
- [![Build Status](https://travis-ci.org/chef/chef_backup.svg?branch=master)](https://travis-ci.org/chef/chef_backup)
3
- [![Gem Version](https://badge.fury.io/rb/chef_backup.svg)](http://badge.fury.io/rb/chef_backup)
4
-
5
- A gem that backs up and restores Chef servers. Used as the backend for
6
- `chef-server-ctl backup` and `chef-server-ctl restore`
7
-
8
- ## Usage
9
-
10
- ```shell
11
- chef-server-ctl backup
12
- chef-server-ctl restore some_backup.tgz
13
- ```
14
-
15
- ## Contributing
16
-
17
- 1. Fork it ( https://github.com/chef/chef_backup/fork )
18
- 2. Create your feature branch (`git checkout -b my-new-feature`)
19
- 3. Commit your changes (`git commit -am 'Add some feature'`)
20
- 4. Push to the branch (`git push origin my-new-feature`)
21
- 5. Create a new Pull Request
data/Rakefile DELETED
@@ -1,44 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- require 'rake'
4
- require 'rspec'
5
- require 'rspec/core'
6
- require 'rspec/core/rake_task'
7
- require 'bundler'
8
- require 'bundler/gem_tasks'
9
- require 'rubocop/rake_task'
10
-
11
- desc 'Default task to run spec suite'
12
- task default: %w(spec rubocop)
13
-
14
- desc 'Run spec suite'
15
- RSpec::Core::RakeTask.new(:spec) do |task|
16
- task.pattern = FileList['spec/**/*_spec.rb']
17
- end
18
-
19
- desc 'Run RSpec with code coverage'
20
- task :coverage do
21
- ENV['COVERAGE'] = 'true'
22
- Rake::Task['spec'].execute
23
- end
24
-
25
- desc 'Run Rubocop style checks'
26
- RuboCop::RakeTask.new do |cop|
27
- cop.fail_on_error = true
28
- end
29
-
30
- desc 'console'
31
- task :console do
32
- require 'pry'
33
- require 'chef_backup'
34
- require 'json'
35
- f = File.expand_path('../spec/fixtures/chef-server-running.json', __FILE__)
36
- running_config = JSON.parse(File.read(f))
37
- @runner = ChefBackup::Runner.new(
38
- running_config.merge('restore_param' => '/tmp/backup.tgz')
39
- )
40
- ARGV.clear
41
- Pry.config.history.should_save = true
42
- Pry.config.history.should_load = true
43
- Pry.start
44
- end
@@ -1,33 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'chef_backup/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'chef_backup'
8
- spec.version = ChefBackup::VERSION
9
- spec.authors = ['Ryan Cragun']
10
- spec.email = ['me@ryan.ec']
11
- spec.summary = 'A library to backup a Chef Server'
12
- spec.description = spec.summary
13
- spec.homepage = 'https://github.com/chef/chef_backup'
14
- spec.license = 'Apachev2'
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(/^(test|spec|features)/)
19
- spec.require_paths = ['lib']
20
-
21
- spec.add_dependency 'di-ruby-lvm'
22
- spec.add_dependency 'mixlib-shellout'
23
- spec.add_dependency 'highline'
24
- spec.add_dependency 'chef'
25
-
26
- spec.add_development_dependency 'bundler', '~> 1.6'
27
- spec.add_development_dependency 'rake'
28
- spec.add_development_dependency 'rspec', '~> 3.0'
29
- spec.add_development_dependency 'guard-rspec'
30
- spec.add_development_dependency 'pry-rescue'
31
- spec.add_development_dependency 'rubocop', '~> 0.37.2'
32
- spec.add_development_dependency 'simplecov'
33
- end