capistrano-postgresql 4.0.0 → 4.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4979d4dae2bd808a75c9656d8206de81940ed8a
4
- data.tar.gz: 985c1c832fcde7f17e129e196e1a4d41ee19420f
3
+ metadata.gz: b311b0bdeec4ade8c62ada9b7d9ec5dd465cb7f9
4
+ data.tar.gz: 143489c7a56470dfc9bc02cd552dffdca481f489
5
5
  SHA512:
6
- metadata.gz: dc3160801f01359dfe35aad44085910b8056ddf09be8e194caff6b0dbb70e0427f469a6223e288c32a10d97085d5d67f55f0cd13237428ab753df08b0bb4da79
7
- data.tar.gz: c4cf87e7bff7d00e1163f50cdd54e9a9bca1ad55b0be1c9bd2bb96edf9a289006bc0a3dc7a4e0058682e57cc01e123caa8469070abff0380ed80c8c68b6a2bbb
6
+ metadata.gz: cf43f13fc0e56ad6ee0d9cb28b06633357b39b209f51c532d47b2ab13141bc84f8b090bcec5b3356731c660f3005d79d076368fb51312bc01db4c1a8ac3d4c89
7
+ data.tar.gz: a4355f5fb71083259f6482df4ad2095f5d4801407b941b5410d9467635acb492665e7d326ec018d07c873055eaad9997e44abd2084705e9eb1d268f145de70a0
@@ -2,6 +2,10 @@
2
2
 
3
3
  ### master
4
4
 
5
+ ### v4.1.0, 2014-10-08
6
+ - automatically set `pg_host` option to the IP address of primary `db` host when
7
+ there are multiple release nodes (@bruno-)
8
+
5
9
  ### v4.0.0, 2014-10-06
6
10
  - enable setting DB environment with `rails_env` option. If `rails_env` is not
7
11
  set, `stage` option is used as until now. (@bruno-)
data/README.md CHANGED
@@ -30,7 +30,7 @@ Put the following in your application's `Gemfile`:
30
30
 
31
31
  group :development do
32
32
  gem 'capistrano', '~> 3.2.0'
33
- gem 'capistrano-postgresql', '~> 4.0.0'
33
+ gem 'capistrano-postgresql', '~> 4.1.0'
34
34
  end
35
35
 
36
36
  Then:
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  https://github.com/bruno-/capistrano2-postgresql
17
17
  EOF
18
18
  gem.summary = %q{Creates application database user and `database.yml` on the server. No SSH login required!}
19
- gem.homepage = "https://github.com/bruno-/capistrano-postgresql"
19
+ gem.homepage = "https://github.com/capistrano-plugins/capistrano-postgresql"
20
20
 
21
21
  gem.license = "MIT"
22
22
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Postgresql
3
- VERSION = "4.0.0"
3
+ VERSION = "4.1.0"
4
4
  end
5
5
  end
@@ -20,7 +20,15 @@ namespace :load do
20
20
  set :pg_env, -> { fetch(:rails_env) || fetch(:stage) }
21
21
  set :pg_pool, 5
22
22
  set :pg_encoding, 'unicode'
23
- set :pg_host, 'localhost'
23
+ # for multiple release nodes automatically use server hostname (IP?) in the database.yml
24
+ set :pg_host, -> do
25
+ if release_roles(:all).count == 1 && release_roles(:all).first == primary(:db)
26
+ 'localhost'
27
+ else
28
+ primary(:db).hostname
29
+ end
30
+ end
31
+
24
32
  end
25
33
  end
26
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-postgresql
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Sutic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-06 00:00:00.000000000 Z
11
+ date: 2014-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -65,7 +65,7 @@ files:
65
65
  - lib/generators/capistrano/postgresql/README.md
66
66
  - lib/generators/capistrano/postgresql/template_generator.rb
67
67
  - lib/generators/capistrano/postgresql/templates/postgresql.yml.erb
68
- homepage: https://github.com/bruno-/capistrano-postgresql
68
+ homepage: https://github.com/capistrano-plugins/capistrano-postgresql
69
69
  licenses:
70
70
  - MIT
71
71
  metadata: {}