parity 3.3.0 → 3.4.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
  SHA256:
3
- metadata.gz: c834b388cde313695a88976083e26335e622880bb7e4ad212b1f177aa4a228c8
4
- data.tar.gz: e842be2ab0f8a556a0da4d51de033e16eb2dc94e659fd1eadbd644c46a221450
3
+ metadata.gz: 848792197642939ee65244b1b52cf46e247aaed2cdd23b7d145f8d0377f6b679
4
+ data.tar.gz: 96c978c1fbd49f12a4b35951da33ca958115875057a35b5be6c0912d9b252f72
5
5
  SHA512:
6
- metadata.gz: 53f990b9c44ac2e8bc38504b6a6730c61931e6fc05d7306bb74b757804a307c1d8219d31f95340dbdacf94e334cf2aa2659a23dd254533a245d9cd2f87380b06
7
- data.tar.gz: '055856a6441a5e409bc0da279d3e937d30604308ccefb4ea0ed5315b715745eb55ef9279cb1adc902113e2eec5b9ab347fcade4598b26174dd68c0b890fe4d5b'
6
+ metadata.gz: f99f89a6f7d44c1223b699c32d80e6ab1279b34f06f6c2efb83d9e4974cd877d98fb4461768d509afb0010c30be0d58b2d86fa70f3f35032e69c29d188fdb864
7
+ data.tar.gz: bd98116578f9f6d492ecf99afd170ac0d242ad9c248f370cdc6f77ad957bd91d7a6bcbfb73cd0261edcc854cfe85484064c63d71efacc6a22bef5f0748022e53
data/README.md CHANGED
@@ -61,7 +61,7 @@ Push your local development database backup up to staging:
61
61
 
62
62
  staging restore development
63
63
 
64
- Deploy master to production (note that prior versions of Parity would run
64
+ Deploy main to production (note that prior versions of Parity would run
65
65
  database migrations, that's now better handled using [Heroku release phase]):
66
66
 
67
67
  production deploy
@@ -197,7 +197,7 @@ See guidelines in [`RELEASING.md`](RELEASING.md) for details
197
197
  License
198
198
  -------
199
199
 
200
- Parity is © 2013-2018 thoughtbot, inc.
200
+ Parity is © 2013-2021 thoughtbot, inc.
201
201
  It is free software,
202
202
  and may be redistributed under the terms specified in the [LICENSE] file.
203
203
 
data/bin/pr_app CHANGED
@@ -9,7 +9,7 @@ if ARGV.empty?
9
9
  else
10
10
  review_app_number = ARGV.first
11
11
  staging_git_remote = Open3.capture3("git remote get-url staging")[0].strip
12
- review_app_prefix = staging_git_remote.split("/").last.gsub(/\.git\Z/, "")[0, 22]
12
+ review_app_prefix = staging_git_remote.split("/").last.gsub(/\.git\Z/, "")[0, 20]
13
13
 
14
14
  exit Parity::Environment.new(
15
15
  "#{review_app_prefix}-pr-#{review_app_number}",
data/lib/parity.rb CHANGED
@@ -4,6 +4,7 @@ require "parity/heroku_app_name"
4
4
  require "parity/version"
5
5
  require "parity/environment"
6
6
  require "parity/usage"
7
+ require "erb"
7
8
  require "open3"
8
9
  require "pathname"
9
10
  require "uri"
data/lib/parity/backup.rb CHANGED
@@ -75,7 +75,7 @@ module Parity
75
75
 
76
76
  def restore_from_local_temp_backup
77
77
  Kernel.system(
78
- "pg_restore tmp/latest.backup --verbose --clean --no-acl --no-owner "\
78
+ "pg_restore tmp/latest.backup --verbose --no-acl --no-owner "\
79
79
  "--dbname #{development_db} --jobs=#{processor_cores} "\
80
80
  "#{additional_args}",
81
81
  )
@@ -114,7 +114,7 @@ module Parity
114
114
  end
115
115
 
116
116
  def database_yaml_file
117
- IO.read(DATABASE_YML_RELATIVE_PATH)
117
+ ERB.new(IO.read(DATABASE_YML_RELATIVE_PATH)).result
118
118
  end
119
119
 
120
120
  def processor_cores
@@ -41,14 +41,27 @@ module Parity
41
41
 
42
42
  def deploy
43
43
  if production?
44
- Kernel.system("git push production master")
44
+ Kernel.system("git push production #{branch_ref}")
45
45
  else
46
46
  Kernel.system(
47
- "git push #{environment} HEAD:master --force",
47
+ "git push #{environment} HEAD:#{branch_ref} --force",
48
48
  )
49
49
  end
50
50
  end
51
51
 
52
+ def branch_ref
53
+ main_ref_exists = system("git show-ref --verify --quiet refs/heads/main")
54
+ master_ref_exists = system(
55
+ "git show-ref --verify --quiet refs/heads/master",
56
+ )
57
+
58
+ if main_ref_exists && !master_ref_exists
59
+ "main"
60
+ else
61
+ "master"
62
+ end
63
+ end
64
+
52
65
  def restore
53
66
  if production? && !forced?
54
67
  $stdout.puts "Parity does not support restoring backups into your "\
@@ -1,3 +1,3 @@
1
1
  module Parity
2
- VERSION = "3.3.0".freeze
2
+ VERSION = "3.4.0".freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parity
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
8
8
  - Geoff Harcourt
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-27 00:00:00.000000000 Z
12
+ date: 2021-06-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |2
15
15
  Development/staging/production parity makes it easier for
@@ -39,7 +39,7 @@ homepage: https://github.com/thoughtbot/parity
39
39
  licenses:
40
40
  - MIT
41
41
  metadata: {}
42
- post_install_message:
42
+ post_install_message:
43
43
  rdoc_options: []
44
44
  require_paths:
45
45
  - lib
@@ -54,8 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.0.6
58
- signing_key:
57
+ rubygems_version: 3.1.6
58
+ signing_key:
59
59
  specification_version: 4
60
60
  summary: Shell commands for development, staging, and production parity.
61
61
  test_files: []