parity 0.9.3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/parity.rb +0 -3
- data/lib/parity/backup.rb +3 -5
- data/lib/parity/environment.rb +21 -15
- data/lib/parity/version.rb +1 -1
- 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: 3a4ad8a985dadd893a7202086e0da85996ae8558
|
4
|
+
data.tar.gz: 78c75fddf7df2acb61d2be2315a9cafab9997098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cca9f7f38b992e9f446ec0e5ad0b1eb745b89dd0b797c8c3ca2fb228872861eaadbb2efdbde051c22c8653f482ae4a3cd2b24b3166c475806d23b1676e06764f
|
7
|
+
data.tar.gz: 309b8d8009b6b51a354f71253d1ca5b83fa2cf158d7f17c129d0a2bc315719b84bbba8e36c5d71c7d61decb67802b75aee91ab0a2617e636165eaa7eda7f21b1
|
data/README.md
CHANGED
@@ -97,9 +97,14 @@ Parity expects:
|
|
97
97
|
|
98
98
|
* A `staging` remote pointing to the staging Heroku app.
|
99
99
|
* A `production` remote pointing to the production Heroku app.
|
100
|
+
```
|
101
|
+
heroku git:remote -r staging -a your-staging-app
|
102
|
+
heroku git:remote -r production -a your-production-app
|
103
|
+
```
|
100
104
|
* There is a `config/database.yml` file that can be parsed as YAML for
|
101
105
|
`['development']['database']`.
|
102
106
|
|
107
|
+
|
103
108
|
Customization
|
104
109
|
-------------
|
105
110
|
|
data/lib/parity.rb
CHANGED
data/lib/parity/backup.rb
CHANGED
@@ -65,15 +65,13 @@ module Parity
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def development_db
|
68
|
-
YAML.load(
|
68
|
+
YAML.load(database_yaml_file).
|
69
69
|
fetch(DEVELOPMENT_ENVIRONMENT_KEY_NAME).
|
70
70
|
fetch(DATABASE_KEY_NAME)
|
71
71
|
end
|
72
72
|
|
73
|
-
def
|
74
|
-
|
75
|
-
yaml_file = IO.read(DATABASE_YML_RELATIVE_PATH)
|
76
|
-
ERB.new(yaml_file).result
|
73
|
+
def database_yaml_file
|
74
|
+
IO.read(DATABASE_YML_RELATIVE_PATH)
|
77
75
|
end
|
78
76
|
end
|
79
77
|
end
|
data/lib/parity/environment.rb
CHANGED
@@ -31,7 +31,7 @@ module Parity
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def run_via_cli
|
34
|
-
Kernel.
|
34
|
+
Kernel.exec("heroku", subcommand, *arguments, "--remote", environment)
|
35
35
|
end
|
36
36
|
|
37
37
|
def backup
|
@@ -57,9 +57,9 @@ module Parity
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def restore
|
60
|
-
if production?
|
60
|
+
if production? && !forced?
|
61
61
|
$stdout.puts "Parity does not support restoring backups into your "\
|
62
|
-
"production environment."
|
62
|
+
"production environment. Use `--force` to override."
|
63
63
|
else
|
64
64
|
Backup.new(
|
65
65
|
from: arguments.first,
|
@@ -75,6 +75,10 @@ module Parity
|
|
75
75
|
environment == "production"
|
76
76
|
end
|
77
77
|
|
78
|
+
def forced?
|
79
|
+
arguments.include?("--force")
|
80
|
+
end
|
81
|
+
|
78
82
|
def additional_restore_arguments
|
79
83
|
(arguments.drop(1) + [restore_confirmation_argument]).
|
80
84
|
compact.
|
@@ -88,19 +92,19 @@ module Parity
|
|
88
92
|
end
|
89
93
|
|
90
94
|
def console
|
91
|
-
Kernel.system("
|
95
|
+
Kernel.system(command_for_remote("run rails console"))
|
92
96
|
end
|
93
97
|
|
94
98
|
def migrate
|
95
99
|
Kernel.system(%{
|
96
|
-
|
97
|
-
|
100
|
+
#{command_for_remote('run rake db:migrate')} &&
|
101
|
+
#{command_for_remote('restart')}
|
98
102
|
})
|
99
103
|
end
|
100
104
|
|
101
105
|
def tail
|
102
106
|
Kernel.system(
|
103
|
-
"
|
107
|
+
command_for_remote("logs --tail #{arguments.join(' ')}"),
|
104
108
|
)
|
105
109
|
end
|
106
110
|
|
@@ -119,18 +123,20 @@ module Parity
|
|
119
123
|
end
|
120
124
|
|
121
125
|
def raw_redis_url
|
122
|
-
@redis_to_go_url ||= Open3.
|
123
|
-
"
|
124
|
-
|
125
|
-
)[0].strip
|
126
|
+
@redis_to_go_url ||= Open3.
|
127
|
+
capture3(command_for_remote("config:get REDIS_URL"))[0].
|
128
|
+
strip
|
126
129
|
end
|
127
130
|
|
128
|
-
def
|
129
|
-
|
131
|
+
def heroku_app_name
|
132
|
+
@heroku_app_name ||= Open3.
|
133
|
+
capture3(command_for_remote("info"))[0].
|
134
|
+
split("\n")[0].
|
135
|
+
gsub(/(\s|=)+/, "")
|
130
136
|
end
|
131
137
|
|
132
|
-
def
|
133
|
-
|
138
|
+
def command_for_remote(command)
|
139
|
+
"heroku #{command} --remote #{environment}"
|
134
140
|
end
|
135
141
|
|
136
142
|
def run_migrations?
|
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: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |2
|
15
15
|
Development/staging/production parity makes it easier for
|
@@ -52,8 +52,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
version: '0'
|
53
53
|
requirements: []
|
54
54
|
rubyforge_project:
|
55
|
-
rubygems_version: 2.
|
55
|
+
rubygems_version: 2.5.0
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: Shell commands for development, staging, and production parity.
|
59
59
|
test_files: []
|
60
|
+
has_rdoc:
|