parity 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab19af3851a95c814e88e88037d24445aa464301
4
- data.tar.gz: 182e5d1e36515d4d7dff7b448ef3f9538796fb3c
3
+ metadata.gz: 90b05270b092fae08ef58d9b542eeee6cf65ea45
4
+ data.tar.gz: 1ff1f8401237aae2ad4b1b3392ce68acf5a653e2
5
5
  SHA512:
6
- metadata.gz: 230918a7340634e31366d9919c9b0949c498e5727793e54ba15ee719076145d6272a1f73f3d5b15dbe98120a3e8d0fc42ca3c48389068988ced76f3c3bfc81aa
7
- data.tar.gz: 6ee596c53623f712b701c7fbfbd89caf987b77930b472fe4ff50b508668cfeb7c055e58222a5217d3f199089710fac5b62ffebc23614df7fddc83785cef0868b
6
+ metadata.gz: 06e4b1a2ab5f55c5c600a8ffc0363f1c5e72167a531e6c830a8dd4527a4192d363336e8af6ab41c8bdc6df5c25060a4524690a8f397af0e216a477d059296e80
7
+ data.tar.gz: a85c997c334b97697f5abdb851006fffe4200a34c007560057853da356c4fd44d06b82e3e3eb098708796dbce753d55c77b591162b87252242fd9408996f0666
data/bin/development ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'parity')
4
+
5
+ if ARGV.empty?
6
+ puts Parity::Usage.new
7
+ else
8
+ exit Parity::Environment.new('development', ARGV).run
9
+ end
data/bin/production ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'parity')
4
+
5
+ if ARGV.empty?
6
+ puts Parity::Usage.new
7
+ else
8
+ exit Parity::Environment.new('production', ARGV).run
9
+ end
data/bin/staging ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'parity')
4
+
5
+ if ARGV.empty?
6
+ puts Parity::Usage.new
7
+ else
8
+ exit Parity::Environment.new('staging', ARGV).run
9
+ end
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 \"$(#{from} pg:backups public-url -q)\"",
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
- "-d #{development_db} #{additional_args}",
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 restore #{backup_from} --remote #{to} "\
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 public-url --remote #{from}"
79
+ "heroku pg:backups:url --remote #{from}"
77
80
  end
78
81
 
79
82
  def development_db
@@ -35,7 +35,7 @@ module Parity
35
35
  end
36
36
 
37
37
  def backup
38
- Kernel.system("heroku pg:backups capture --remote #{environment}")
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..master -- db/migrate
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
@@ -1,3 +1,3 @@
1
1
  module Parity
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
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: 1.0.0
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-09-16 00:00:00.000000000 Z
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: '0'
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: