parity 0.4.1 → 0.5.0
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 +23 -1
- data/lib/parity.rb +3 -0
- data/lib/parity/backup.rb +10 -4
- data/lib/parity/environment.rb +6 -2
- data/lib/parity/version.rb +3 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7c1049857702263e307ef2d3373b55675e3818d
|
4
|
+
data.tar.gz: bbea30205de851f9e3777fa0a7d0b475448d4223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad024844dd58f0c4a61bbe35fb5bf8212abfba920df228190180772755a43e8c883115d9f8f3d7f10eab2429f7a4ee86013d194dfc718f58c1d9a8a7377893b
|
7
|
+
data.tar.gz: c68c3a72b47db97e43061d30f1b3b089b6d5c06ffaaa3d2c558ef12e962c0e376c2eb05b3c3a04bee2339c0532f6a36cdf484870a50564a847632e1f2a30998e
|
data/README.md
CHANGED
@@ -22,14 +22,31 @@ and the other programs can be installed with Homebrew:
|
|
22
22
|
Install
|
23
23
|
-------
|
24
24
|
|
25
|
+
OSX:
|
26
|
+
|
27
|
+
brew tap thoughtbot/formulae
|
28
|
+
brew install parity
|
29
|
+
|
30
|
+
On other systems you can:
|
31
|
+
|
32
|
+
1. Download the package for your system from the [releases
|
33
|
+
page][releases]
|
34
|
+
2. Extract the tarball and place it so that `/bin` is in your `PATH`
|
35
|
+
|
36
|
+
Alternatively, you can do the following on all systems
|
37
|
+
(requires a Ruby installation):
|
38
|
+
|
25
39
|
gem install parity
|
26
40
|
|
27
|
-
|
41
|
+
All these methods install the following three shell commands:
|
28
42
|
|
29
43
|
development
|
30
44
|
staging
|
31
45
|
production
|
32
46
|
|
47
|
+
|
48
|
+
[releases]: https://github.com/croaky/parity/releases
|
49
|
+
|
33
50
|
Usage
|
34
51
|
-----
|
35
52
|
|
@@ -130,6 +147,11 @@ Contributing
|
|
130
147
|
|
131
148
|
Please see CONTRIBUTING.md for details.
|
132
149
|
|
150
|
+
Releasing
|
151
|
+
---------
|
152
|
+
|
153
|
+
See guidelines in RELEASING.md for details
|
154
|
+
|
133
155
|
Credits
|
134
156
|
-------
|
135
157
|
|
data/lib/parity.rb
CHANGED
data/lib/parity/backup.rb
CHANGED
@@ -4,6 +4,7 @@ module Parity
|
|
4
4
|
class Backup
|
5
5
|
def initialize(args)
|
6
6
|
@from, @to = args.values_at(:from, :to)
|
7
|
+
@additional_args = args[:additional_args] || ""
|
7
8
|
end
|
8
9
|
|
9
10
|
def restore
|
@@ -14,9 +15,11 @@ module Parity
|
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
17
|
-
|
18
|
+
protected
|
19
|
+
|
20
|
+
attr_reader :additional_args, :from, :to
|
18
21
|
|
19
|
-
|
22
|
+
private
|
20
23
|
|
21
24
|
def restore_to_development
|
22
25
|
Kernel.system "#{curl} | #{pg_restore}"
|
@@ -31,7 +34,10 @@ module Parity
|
|
31
34
|
end
|
32
35
|
|
33
36
|
def restore_to_pass_through
|
34
|
-
Kernel.system
|
37
|
+
Kernel.system(
|
38
|
+
"heroku pg:backups restore #{backup_from} --remote #{to} "\
|
39
|
+
"#{additional_args}"
|
40
|
+
)
|
35
41
|
end
|
36
42
|
|
37
43
|
def backup_from
|
@@ -39,7 +45,7 @@ module Parity
|
|
39
45
|
end
|
40
46
|
|
41
47
|
def db_backup_url
|
42
|
-
"heroku
|
48
|
+
"heroku pg:backups public-url --remote #{from}"
|
43
49
|
end
|
44
50
|
|
45
51
|
def development_db
|
data/lib/parity/environment.rb
CHANGED
@@ -31,7 +31,7 @@ module Parity
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def backup
|
34
|
-
Kernel.system "heroku
|
34
|
+
Kernel.system "heroku pg:backups capture --expire --remote #{environment}"
|
35
35
|
end
|
36
36
|
|
37
37
|
def restore
|
@@ -39,7 +39,11 @@ module Parity
|
|
39
39
|
$stdout.puts "Parity does not support restoring backups into your "\
|
40
40
|
"production environment."
|
41
41
|
else
|
42
|
-
Backup.new(
|
42
|
+
Backup.new(
|
43
|
+
from: arguments.first,
|
44
|
+
to: environment,
|
45
|
+
additional_args: arguments.drop(1).join(" ")
|
46
|
+
).restore
|
43
47
|
end
|
44
48
|
end
|
45
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Development/staging/production parity makes it easier for
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/parity/configuration.rb
|
32
32
|
- lib/parity/environment.rb
|
33
33
|
- lib/parity/usage.rb
|
34
|
+
- lib/parity/version.rb
|
34
35
|
homepage: https://github.com/croaky/parity
|
35
36
|
licenses:
|
36
37
|
- MIT
|
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
52
|
version: '0'
|
52
53
|
requirements: []
|
53
54
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
55
|
+
rubygems_version: 2.4.5
|
55
56
|
signing_key:
|
56
57
|
specification_version: 4
|
57
58
|
summary: Shell commands for development, staging, and production parity.
|