stratocumulus 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/README.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Stratocumulus
2
+ [![Build Status](https://travis-ci.org/reevoo/stratocumulus.svg?branch=master)](https://travis-ci.org/reevoo/stratocumulus)
3
+ [![Coverage Status](https://coveralls.io/repos/reevoo/stratocumulus/badge.png)](https://coveralls.io/r/reevoo/stratocumulus)
4
+ [![Code Climate](https://codeclimate.com/github/reevoo/stratocumulus.png)](https://codeclimate.com/github/reevoo/stratocumulus)
5
+ [![Gem Version](https://badge.fury.io/rb/stratocumulus.svg)](http://badge.fury.io/rb/stratocumulus)
6
+
2
7
 
3
8
  Stratocumulus is for backing up databases to cloud storage
4
9
 
@@ -8,7 +13,33 @@ Stratocumulus is for backing up databases to cloud storage
8
13
 
9
14
  ## Usage
10
15
 
11
- TODO: Write usage instructions here
16
+ $ stratocumulus backup /path/to/config.yml
17
+
18
+ ```YAML
19
+ s3:
20
+ access_key_id: KEY_ID
21
+ secret_access_key: SECRET_KEY
22
+ bucket: database-backups
23
+ region: eu-west-1 # defaults to us-east-1
24
+ databases:
25
+ -
26
+ type: mysql
27
+ name: database_name
28
+ storage: s3
29
+ username: database_user # defaults to root
30
+ password: database_pass # defaults to no password
31
+ host: db1.example.com # defaults to localhost
32
+ port: 3306 # defaults to 3306
33
+ -
34
+ type: mysql
35
+ name: some_other_database
36
+ storage: s3
37
+ ```
38
+ ## Dependencies
39
+
40
+ * mysqldump
41
+ * gzip
42
+ * Ruby, (tested on mri 1.9.3, 2.0.0 and 2.1.2)
12
43
 
13
44
  ## Contributing
14
45
 
data/bin/stratocumulus CHANGED
@@ -1,17 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
-
4
- require 'thor'
5
3
  require 'stratocumulus'
6
4
 
7
- module Stratocumulus
8
- class Cli < Thor
9
- desc 'backup CONFIG',
10
- 'runs a stratocumulus backup as specified in the config file'
11
- def backup(config)
12
- Stratocumulus::Runner.new(config).run
13
- end
14
- end
15
- end
16
-
17
5
  Stratocumulus::Cli.start
@@ -0,0 +1,12 @@
1
+ # encoding: UTF-8
2
+ require 'thor'
3
+
4
+ module Stratocumulus
5
+ class Cli < Thor
6
+ desc 'backup CONFIG',
7
+ 'runs a stratocumulus backup as specified in the config file'
8
+ def backup(config)
9
+ Stratocumulus::Runner.new(config).run
10
+ end
11
+ end
12
+ end
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Stratocumulus
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
data/lib/stratocumulus.rb CHANGED
@@ -3,3 +3,4 @@ require 'stratocumulus/version'
3
3
  require 'stratocumulus/database'
4
4
  require 'stratocumulus/storage'
5
5
  require 'stratocumulus/runner'
6
+ require 'stratocumulus/cli'
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,15 @@
1
1
  # encoding: UTF-8
2
+ require 'simplecov'
3
+ require 'coveralls'
4
+
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
6
+ SimpleCov::Formatter::HTMLFormatter,
7
+ Coveralls::SimpleCov::Formatter
8
+ ]
9
+
10
+ SimpleCov.start do
11
+ minimum_coverage 100
12
+ end
2
13
 
3
14
  require 'bundler/setup'
4
15
  Bundler.setup
@@ -0,0 +1,17 @@
1
+ # encoding: UTF-8
2
+ require 'spec_helper'
3
+
4
+ describe Stratocumulus::Cli do
5
+ describe '#backups' do
6
+ let(:runner) { double }
7
+
8
+ it 'calls the runner with the path' do
9
+ expect(Stratocumulus::Runner).to receive(:new)
10
+ .with('/path/to/config.yml').and_return(runner)
11
+
12
+ expect(runner).to receive(:run)
13
+
14
+ subject.backup '/path/to/config.yml'
15
+ end
16
+ end
17
+ end
@@ -19,8 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'fog', '~> 1.22'
22
+ spec.add_dependency 'thor', '~> 0.19.1'
22
23
  spec.add_development_dependency 'bundler', '~> 1.5'
23
24
  spec.add_development_dependency 'rake'
24
25
  spec.add_development_dependency 'rubocop'
25
26
  spec.add_development_dependency 'rspec', '~> 3.0'
27
+ spec.add_development_dependency 'coveralls'
28
+ spec.add_development_dependency 'simplecov'
26
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stratocumulus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.22'
30
+ - !ruby/object:Gem::Dependency
31
+ name: thor
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.19.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.19.1
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: bundler
32
48
  requirement: !ruby/object:Gem::Requirement
@@ -91,6 +107,38 @@ dependencies:
91
107
  - - ~>
92
108
  - !ruby/object:Gem::Version
93
109
  version: '3.0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: coveralls
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
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
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: simplecov
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
94
142
  description: Backup Databases to Cloud Storage
95
143
  email:
96
144
  - ed.robinson@reevoo.com
@@ -99,6 +147,7 @@ executables:
99
147
  extensions: []
100
148
  extra_rdoc_files: []
101
149
  files:
150
+ - .coveralls.yml
102
151
  - .gitignore
103
152
  - .rspec
104
153
  - .rubocop.yml
@@ -109,6 +158,7 @@ files:
109
158
  - Rakefile
110
159
  - bin/stratocumulus
111
160
  - lib/stratocumulus.rb
161
+ - lib/stratocumulus/cli.rb
112
162
  - lib/stratocumulus/database.rb
113
163
  - lib/stratocumulus/ext/io.rb
114
164
  - lib/stratocumulus/runner.rb
@@ -119,6 +169,7 @@ files:
119
169
  - spec/spec_helper.rb
120
170
  - spec/support/test.sql
121
171
  - spec/support/test_config_file.yml
172
+ - spec/unit/cli_spec.rb
122
173
  - spec/unit/database_spec.rb
123
174
  - spec/unit/runner_spec.rb
124
175
  - spec/unit/storage_spec.rb
@@ -138,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
189
  version: '0'
139
190
  segments:
140
191
  - 0
141
- hash: 138837949787604708
192
+ hash: -3829672677026677809
142
193
  required_rubygems_version: !ruby/object:Gem::Requirement
143
194
  none: false
144
195
  requirements:
@@ -147,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
198
  version: '0'
148
199
  segments:
149
200
  - 0
150
- hash: 138837949787604708
201
+ hash: -3829672677026677809
151
202
  requirements: []
152
203
  rubyforge_project:
153
204
  rubygems_version: 1.8.25
@@ -160,6 +211,7 @@ test_files:
160
211
  - spec/spec_helper.rb
161
212
  - spec/support/test.sql
162
213
  - spec/support/test_config_file.yml
214
+ - spec/unit/cli_spec.rb
163
215
  - spec/unit/database_spec.rb
164
216
  - spec/unit/runner_spec.rb
165
217
  - spec/unit/storage_spec.rb