parity 1.0.0 → 2.0.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/bin/development +9 -0
- data/bin/production +9 -0
- data/bin/staging +9 -0
- data/lib/parity/backup.rb +7 -4
- data/lib/parity/environment.rb +10 -2
- data/lib/parity/version.rb +1 -1
- metadata +12 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90b05270b092fae08ef58d9b542eeee6cf65ea45
|
4
|
+
data.tar.gz: 1ff1f8401237aae2ad4b1b3392ce68acf5a653e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e4b1a2ab5f55c5c600a8ffc0363f1c5e72167a531e6c830a8dd4527a4192d363336e8af6ab41c8bdc6df5c25060a4524690a8f397af0e216a477d059296e80
|
7
|
+
data.tar.gz: a85c997c334b97697f5abdb851006fffe4200a34c007560057853da356c4fd44d06b82e3e3eb098708796dbce753d55c77b591162b87252242fd9408996f0666
|
data/bin/development
ADDED
data/bin/production
ADDED
data/bin/staging
ADDED
data/lib/parity/backup.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "etc"
|
2
|
+
|
1
3
|
module Parity
|
2
4
|
class Backup
|
3
5
|
BLANK_ARGUMENTS = "".freeze
|
@@ -46,14 +48,15 @@ module Parity
|
|
46
48
|
|
47
49
|
def download_remote_backup
|
48
50
|
Kernel.system(
|
49
|
-
"curl -o tmp/latest.backup \"$(
|
51
|
+
"curl -o tmp/latest.backup \"$(heroku pg:backups:url --remote #{from})\"",
|
50
52
|
)
|
51
53
|
end
|
52
54
|
|
53
55
|
def restore_from_local_temp_backup
|
54
56
|
Kernel.system(
|
55
57
|
"pg_restore tmp/latest.backup --verbose --clean --no-acl --no-owner "\
|
56
|
-
"
|
58
|
+
"--dbname #{development_db} --jobs #{Etc.nprocessors} "\
|
59
|
+
"#{additional_args}",
|
57
60
|
)
|
58
61
|
end
|
59
62
|
|
@@ -63,7 +66,7 @@ module Parity
|
|
63
66
|
|
64
67
|
def restore_to_remote_environment
|
65
68
|
Kernel.system(
|
66
|
-
"heroku pg:backups
|
69
|
+
"heroku pg:backups:restore #{backup_from} --remote #{to} "\
|
67
70
|
"#{additional_args}",
|
68
71
|
)
|
69
72
|
end
|
@@ -73,7 +76,7 @@ module Parity
|
|
73
76
|
end
|
74
77
|
|
75
78
|
def remote_db_backup_url
|
76
|
-
"heroku pg:backups
|
79
|
+
"heroku pg:backups:url --remote #{from}"
|
77
80
|
end
|
78
81
|
|
79
82
|
def development_db
|
data/lib/parity/environment.rb
CHANGED
@@ -35,7 +35,7 @@ module Parity
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def backup
|
38
|
-
Kernel.system("heroku pg:backups
|
38
|
+
Kernel.system("heroku pg:backups:capture --remote #{environment}")
|
39
39
|
end
|
40
40
|
|
41
41
|
def deploy
|
@@ -158,10 +158,18 @@ module Parity
|
|
158
158
|
def pending_migrations?
|
159
159
|
!Kernel.system(%{
|
160
160
|
git fetch #{environment} &&
|
161
|
-
git diff --quiet #{environment}/master
|
161
|
+
git diff --quiet #{environment}/master..#{compare_with} -- db/migrate
|
162
162
|
})
|
163
163
|
end
|
164
164
|
|
165
|
+
def compare_with
|
166
|
+
if production?
|
167
|
+
"master"
|
168
|
+
else
|
169
|
+
"HEAD"
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
165
173
|
def methodized_subcommand
|
166
174
|
subcommand.gsub("-", "_").to_sym
|
167
175
|
end
|
data/lib/parity/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
@@ -9,18 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |2
|
15
15
|
Development/staging/production parity makes it easier for
|
16
16
|
those who write the code to deploy the code.
|
17
17
|
email:
|
18
18
|
- dan@thoughtbot.com
|
19
|
-
executables:
|
19
|
+
executables:
|
20
|
+
- development
|
21
|
+
- staging
|
22
|
+
- production
|
20
23
|
extensions: []
|
21
24
|
extra_rdoc_files: []
|
22
25
|
files:
|
23
26
|
- README.md
|
27
|
+
- bin/development
|
28
|
+
- bin/production
|
29
|
+
- bin/staging
|
24
30
|
- lib/parity.rb
|
25
31
|
- lib/parity/backup.rb
|
26
32
|
- lib/parity/environment.rb
|
@@ -30,23 +36,7 @@ homepage: https://github.com/thoughtbot/parity
|
|
30
36
|
licenses:
|
31
37
|
- MIT
|
32
38
|
metadata: {}
|
33
|
-
post_install_message:
|
34
|
-
##################################################
|
35
|
-
# NOTE FOR UPGRADING FROM 0.9.3 OR EARLIER #
|
36
|
-
##################################################
|
37
|
-
|
38
|
-
As of version 1.0.0, Parity no longer distributes its executables via Rubygems.
|
39
|
-
|
40
|
-
If you use apt or Homebrew to install dependencies, you can install Parity
|
41
|
-
through those package managers to get the `development`, `staging`, and
|
42
|
-
`production` executables. Installing the executables via package manager makes
|
43
|
-
the programs available across Ruby versions.
|
44
|
-
|
45
|
-
Users without access to those package managers or who prefer to self-install can
|
46
|
-
find the executables at our Github repository:
|
47
|
-
|
48
|
-
https://github.com/thoughtbot/parity
|
49
|
-
|
39
|
+
post_install_message:
|
50
40
|
rdoc_options: []
|
51
41
|
require_paths:
|
52
42
|
- lib
|
@@ -54,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
44
|
requirements:
|
55
45
|
- - ">="
|
56
46
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
47
|
+
version: 2.2.0
|
58
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
49
|
requirements:
|
60
50
|
- - ">="
|
@@ -67,3 +57,4 @@ signing_key:
|
|
67
57
|
specification_version: 4
|
68
58
|
summary: Shell commands for development, staging, and production parity.
|
69
59
|
test_files: []
|
60
|
+
has_rdoc:
|