chef_backup 0.0.1.dev.1 → 0.0.1.dev.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 +4 -4
- data/README.md +5 -17
- data/chef_backup.gemspec +2 -2
- data/lib/chef_backup/helpers.rb +0 -12
- data/lib/chef_backup/logger.rb +6 -6
- data/lib/chef_backup/strategy/backup/tar.rb +5 -0
- data/lib/chef_backup/version.rb +1 -1
- data/spec/unit/strategy/backup/tar_spec.rb +14 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77676069a215d7829c14023e70d43e71d27581a1
|
4
|
+
data.tar.gz: e218d8428ec0edb82a440f9003db3035435e539d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3850ccefb42090d4c73decaa3c9c661d50529aee9eb00a667bb97f648337871e2dafa9fbe1ad6c8cbb082f6ccb908a3d8799721da778c133402530fdb7c5d7c
|
7
|
+
data.tar.gz: d89dc2fb4ef4bc7d95f907e1dec161cb26a0ff2749cee9e8cb1069e823c345d255a42227edd0cf48f638cbc2277d497fedc90689f95102b8f5f4a77599331708
|
data/README.md
CHANGED
@@ -1,21 +1,9 @@
|
|
1
1
|
# ChefBackup
|
2
|
-
[](https://travis-ci.org/chef/chef_backup)
|
3
|
+
[](http://badge.fury.io/rb/chef_backup)
|
3
4
|
|
4
|
-
A gem that backs up and restores Chef servers.
|
5
|
-
|
6
|
-
## Installation
|
7
|
-
|
8
|
-
Add this line to your application's Gemfile:
|
9
|
-
|
10
|
-
gem 'chef_backup'
|
11
|
-
|
12
|
-
And then execute:
|
13
|
-
|
14
|
-
$ bundle
|
15
|
-
|
16
|
-
Or install it yourself as:
|
17
|
-
|
18
|
-
$ gem install chef_backup
|
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`
|
19
7
|
|
20
8
|
## Usage
|
21
9
|
|
@@ -26,7 +14,7 @@ chef-server-ctl restore some_backup.tgz
|
|
26
14
|
|
27
15
|
## Contributing
|
28
16
|
|
29
|
-
1. Fork it ( https://github.com/
|
17
|
+
1. Fork it ( https://github.com/chef/chef_backup/fork )
|
30
18
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
19
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
20
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/chef_backup.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = ChefBackup::VERSION
|
9
9
|
spec.authors = ['Ryan Cragun']
|
10
10
|
spec.email = ['me@ryan.ec']
|
11
|
-
spec.summary = 'A library to backup
|
11
|
+
spec.summary = 'A library to backup a Chef Server'
|
12
12
|
spec.description = spec.summary
|
13
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/chef/chef_backup'
|
14
14
|
spec.license = 'Apachev2'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/chef_backup/helpers.rb
CHANGED
@@ -100,18 +100,6 @@ module Helpers
|
|
100
100
|
File.directory?("/etc/#{service}")
|
101
101
|
end
|
102
102
|
|
103
|
-
def pg_dump?
|
104
|
-
if frontend? # don't dump postgres on frontends
|
105
|
-
false
|
106
|
-
elsif private_chef['backup']['always_dump_db'] == true # defaults to true
|
107
|
-
true
|
108
|
-
elsif strategy !~ /lvm|ebs/ && backend? # backup non-block device backends
|
109
|
-
true
|
110
|
-
else
|
111
|
-
false # if we made it here then we're on lvm/ebs and overrode defaults
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
103
|
def strategy
|
116
104
|
private_chef['backup']['strategy']
|
117
105
|
end
|
data/lib/chef_backup/logger.rb
CHANGED
@@ -15,25 +15,25 @@ module ChefBackup
|
|
15
15
|
attr_accessor :stdout
|
16
16
|
|
17
17
|
def initialize(logfile = nil)
|
18
|
-
|
19
|
-
@highline = HighLine.new($stdin,
|
18
|
+
$stdout = logfile ? File.open(logfile, 'ab') : $stdout
|
19
|
+
@highline = HighLine.new($stdin, $stdout)
|
20
20
|
end
|
21
21
|
|
22
22
|
def log(msg, level = :info)
|
23
23
|
case level
|
24
24
|
when :warn
|
25
25
|
msg = "WARNING: #{msg}"
|
26
|
-
|
26
|
+
$stdout.puts(color? ? @highline.color(msg, :yellow) : msg)
|
27
27
|
when :error
|
28
28
|
msg = "ERROR: #{msg}"
|
29
|
-
|
29
|
+
$stdout.puts(color? ? @highline.color(msg, :red) : msg)
|
30
30
|
else
|
31
|
-
|
31
|
+
$stdout.puts(msg)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
def color?
|
36
|
-
|
36
|
+
$stdout.tty?
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/lib/chef_backup/version.rb
CHANGED
@@ -277,4 +277,18 @@ describe ChefBackup::Strategy::TarBackup do
|
|
277
277
|
end
|
278
278
|
end
|
279
279
|
end
|
280
|
+
|
281
|
+
describe '.pg_dump?' do
|
282
|
+
it 'returns true' do
|
283
|
+
expect(subject.pg_dump?).to eq(true)
|
284
|
+
end
|
285
|
+
|
286
|
+
context 'when db dump is disabled' do
|
287
|
+
before { private_chef('backup' => { 'always_dump_db' => false }) }
|
288
|
+
|
289
|
+
it 'returns false' do
|
290
|
+
expect(subject.pg_dump?).to eq(false)
|
291
|
+
end
|
292
|
+
end
|
293
|
+
end
|
280
294
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.dev.
|
4
|
+
version: 0.0.1.dev.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Cragun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: di-ruby-lvm
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
description: A library to backup
|
167
|
+
description: A library to backup a Chef Server
|
168
168
|
email:
|
169
169
|
- me@ryan.ec
|
170
170
|
executables: []
|
@@ -213,7 +213,7 @@ files:
|
|
213
213
|
- spec/unit/strategy/restore/shared_examples/restore.rb
|
214
214
|
- spec/unit/strategy/restore/tar_spec.rb
|
215
215
|
- spec/unit/strategy_spec.rb
|
216
|
-
homepage: https://github.com/
|
216
|
+
homepage: https://github.com/chef/chef_backup
|
217
217
|
licenses:
|
218
218
|
- Apachev2
|
219
219
|
metadata: {}
|
@@ -236,7 +236,7 @@ rubyforge_project:
|
|
236
236
|
rubygems_version: 2.2.2
|
237
237
|
signing_key:
|
238
238
|
specification_version: 4
|
239
|
-
summary: A library to backup
|
239
|
+
summary: A library to backup a Chef Server
|
240
240
|
test_files:
|
241
241
|
- spec/fixtures/chef-server-running.json
|
242
242
|
- spec/spec_helper.rb
|