db_backups 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/bin/db_backups +14 -5
- data/lib/db_backups.rb +3 -0
- data/lib/db_backups/container.rb +1 -0
- data/lib/db_backups/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea768e7ae5ee438f97a82492a8c20f33b3f1793d
|
4
|
+
data.tar.gz: a101c6236d9fe6ce40892bdeda06c2641c004545
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f387399abcfd2bc3087398b9768b558d48fc10b958aeac1eb76343223cca2a310242975dd7c6c73a7c74063dc7afc03e73e82eb79d007100aa30686f8b8360c0
|
7
|
+
data.tar.gz: f7b4fa9e8bc5332373c4bce01759aa46fcd1e7ec936064ec534a2c76c965c56fc8e03559ffc1ee82b734a4840d7b1859e7b1770016c38c18c701a8c0c2b42ea3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## (unreleased) [![Gem Version](https://badge.fury.io/rb/db_backups.png)](http://badge.fury.io/rb/db_backups)
|
4
4
|
|
5
|
+
## 0.0.12 (Jul 24, 2013)
|
6
|
+
|
7
|
+
* Add version command
|
8
|
+
* Get app name from APP_NAME env var (default to use current directory name)
|
9
|
+
|
5
10
|
## 0.0.11 (Jul 23, 2013)
|
6
11
|
|
7
12
|
* Add CHANGELOG
|
data/bin/db_backups
CHANGED
@@ -5,11 +5,15 @@ require 'rubygems/package'
|
|
5
5
|
require 'open3'
|
6
6
|
|
7
7
|
require 'optitron'
|
8
|
-
require 'db_backups
|
9
|
-
require 'db_backups/db_config'
|
8
|
+
require 'db_backups'
|
10
9
|
|
11
10
|
class DbBackups::CLI < Optitron::CLI
|
12
11
|
|
12
|
+
class_opt :app_name,
|
13
|
+
'App name (Or use APP_NAME env var, default: current directory name)',
|
14
|
+
:in => %w{staging uat production} ,
|
15
|
+
:default => 'production'
|
16
|
+
|
13
17
|
class_opt :environment,
|
14
18
|
'Source Environment (NB. Destination Environment comes from RAILS_ENV var, default: development)',
|
15
19
|
:in => %w{staging uat production} ,
|
@@ -19,6 +23,12 @@ class DbBackups::CLI < Optitron::CLI
|
|
19
23
|
'(defaults to ord - Chicago)',
|
20
24
|
:default => 'ord'
|
21
25
|
|
26
|
+
# eergh... is it possible to use `--version` for version?
|
27
|
+
desc 'Version'
|
28
|
+
def version
|
29
|
+
puts DbBackups::VERSION
|
30
|
+
end
|
31
|
+
|
22
32
|
desc 'Index backups'
|
23
33
|
def index
|
24
34
|
puts container
|
@@ -91,13 +101,12 @@ class DbBackups::CLI < Optitron::CLI
|
|
91
101
|
def app_dir
|
92
102
|
@app_dir ||= begin
|
93
103
|
pwd = `basename $(pwd)`.strip
|
94
|
-
pwd
|
104
|
+
pwd == 'current' ? `basename $(cd ..; pwd)`.strip : pwd
|
95
105
|
end
|
96
106
|
end
|
97
107
|
|
98
108
|
def app
|
99
|
-
|
100
|
-
@app ||= app_dir == 'travel_management_platform' ? 'tmp' : app_dir
|
109
|
+
@app ||= ENV.fetch('APP_NAME', app_dir)
|
101
110
|
end
|
102
111
|
|
103
112
|
def environment
|
data/lib/db_backups.rb
ADDED
data/lib/db_backups/container.rb
CHANGED
@@ -9,6 +9,7 @@ module DbBackups
|
|
9
9
|
attr_reader :app, :environment
|
10
10
|
|
11
11
|
def initialize(app, environment, opts={})
|
12
|
+
puts "Connecting to container for app: #{app.inspect} in environment: #{environment.inspect} #{opts.inspect unless opts.empty?} ..."
|
12
13
|
@app = app
|
13
14
|
@environment = environment
|
14
15
|
@opts = opts
|
data/lib/db_backups/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: db_backups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: optitron
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- Rakefile
|
82
82
|
- bin/db_backups
|
83
83
|
- db_backups.gemspec
|
84
|
+
- lib/db_backups.rb
|
84
85
|
- lib/db_backups/container.rb
|
85
86
|
- lib/db_backups/db_backup.rb
|
86
87
|
- lib/db_backups/db_config.rb
|