parity 0.2.1 → 0.3.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 +41 -8
- data/bin/development +1 -1
- data/bin/production +1 -1
- data/bin/staging +1 -1
- data/lib/parity.rb +1 -3
- data/lib/parity/environment.rb +10 -0
- metadata +3 -6
- data/lib/parity/development.rb +0 -16
- data/lib/parity/production.rb +0 -9
- data/lib/parity/staging.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba2da5e28e45e4da467bb10816894ec696ea09e9
|
4
|
+
data.tar.gz: bccaf36f3dd62f5a12da6c22579d94b85073dcce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 919d2eb79df6ecd477739a1d05990a21c2822462576fa6e2f43c7e1b5164341db3ff651405fb491d7e10d2d78d32b3c167f086f9d307727adc81705814cfe980
|
7
|
+
data.tar.gz: 3f3cb32cb5406fb538890abaa0308711176883a42050f225cef5ab70e83371cdf361c4b8b60b1c60be05fcf86b4392d58b7da6b8ac5705f2d7b300c4aedc632b
|
data/README.md
CHANGED
@@ -3,6 +3,21 @@ Parity
|
|
3
3
|
|
4
4
|
Shell commands for development, staging, and production parity for Heroku apps.
|
5
5
|
|
6
|
+
Prerequisites
|
7
|
+
-------------
|
8
|
+
|
9
|
+
Your development machine will need these command-line programs:
|
10
|
+
|
11
|
+
curl
|
12
|
+
heroku
|
13
|
+
pg_restore
|
14
|
+
|
15
|
+
On a Mac, `curl` is installed by default and the other programs can be installed
|
16
|
+
with Homebrew:
|
17
|
+
|
18
|
+
brew install heroku-toolbelt
|
19
|
+
brew install postgres --no-python
|
20
|
+
|
6
21
|
Install
|
7
22
|
-------
|
8
23
|
|
@@ -14,17 +29,30 @@ This installs three shell commands:
|
|
14
29
|
staging
|
15
30
|
production
|
16
31
|
|
17
|
-
|
32
|
+
Customization
|
33
|
+
-------------
|
18
34
|
|
19
|
-
|
20
|
-
|
21
|
-
|
35
|
+
If you have Heroku environments beyond staging and production (such as a feature
|
36
|
+
environment for each developer), you can add a [binstub] to the `bin` folder of
|
37
|
+
your application. Custom environments share behavior with staging: they can be
|
38
|
+
backed up and can restore from production.
|
22
39
|
|
23
|
-
|
24
|
-
with Homebrew:
|
40
|
+
[binstub]: https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs
|
25
41
|
|
26
|
-
|
27
|
-
|
42
|
+
Here's an example binstub for a 'feature-geoff' environment, hosted at
|
43
|
+
myapp-feature-geoff.herokuapp.com.
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
#!/usr/bin/env ruby
|
47
|
+
|
48
|
+
require 'parity'
|
49
|
+
|
50
|
+
if ARGV.empty?
|
51
|
+
puts Parity::Usage.new
|
52
|
+
else
|
53
|
+
Parity::HerokuEnvironment.new('feature-geoff', ARGV).run
|
54
|
+
end
|
55
|
+
```
|
28
56
|
|
29
57
|
Usage
|
30
58
|
-----
|
@@ -93,6 +121,11 @@ Parity.configure do |config|
|
|
93
121
|
end
|
94
122
|
```
|
95
123
|
|
124
|
+
Contributing
|
125
|
+
------------
|
126
|
+
|
127
|
+
Please see CONTRIBUTING.md for details.
|
128
|
+
|
96
129
|
Credits
|
97
130
|
-------
|
98
131
|
|
data/bin/development
CHANGED
data/bin/production
CHANGED
data/bin/staging
CHANGED
data/lib/parity.rb
CHANGED
data/lib/parity/environment.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'parity/backup'
|
2
|
+
|
1
3
|
module Parity
|
2
4
|
class Environment
|
3
5
|
def initialize(environment, subcommands)
|
@@ -30,6 +32,14 @@ module Parity
|
|
30
32
|
Kernel.system "heroku pgbackups:capture --expire --remote #{environment}"
|
31
33
|
end
|
32
34
|
|
35
|
+
def restore
|
36
|
+
if environment == "production"
|
37
|
+
$stdout.puts "Parity does not support restoring backups into your production environment."
|
38
|
+
else
|
39
|
+
Backup.new(from: arguments.first, to: environment).restore
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
33
43
|
def console
|
34
44
|
Kernel.system "heroku run rails console --remote #{environment}"
|
35
45
|
end
|
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.3.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: 2014-
|
11
|
+
date: 2014-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Devevelopment/staging/production parity is intended to decrease the time
|
@@ -31,10 +31,7 @@ files:
|
|
31
31
|
- lib/parity.rb
|
32
32
|
- lib/parity/backup.rb
|
33
33
|
- lib/parity/configuration.rb
|
34
|
-
- lib/parity/development.rb
|
35
34
|
- lib/parity/environment.rb
|
36
|
-
- lib/parity/production.rb
|
37
|
-
- lib/parity/staging.rb
|
38
35
|
- lib/parity/usage.rb
|
39
36
|
homepage: https://github.com/croaky/parity
|
40
37
|
licenses:
|
@@ -56,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
53
|
version: '0'
|
57
54
|
requirements: []
|
58
55
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.2.
|
56
|
+
rubygems_version: 2.2.2
|
60
57
|
signing_key:
|
61
58
|
specification_version: 4
|
62
59
|
summary: Shell commands for development, staging, and production parity.
|
data/lib/parity/development.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'parity/backup'
|
2
|
-
require 'parity/environment'
|
3
|
-
|
4
|
-
module Parity
|
5
|
-
class Development < Environment
|
6
|
-
def initialize(subcommands)
|
7
|
-
super 'development', subcommands
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def restore
|
13
|
-
Backup.new(from: arguments.first, to: 'development').restore
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/parity/production.rb
DELETED
data/lib/parity/staging.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'parity/backup'
|
2
|
-
require 'parity/environment'
|
3
|
-
|
4
|
-
module Parity
|
5
|
-
class Staging < Environment
|
6
|
-
def initialize(subcommands)
|
7
|
-
super 'staging', subcommands
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def restore
|
13
|
-
Backup.new(from: arguments.first, to: 'staging').restore
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|