capistrano3-postgres 0.2.2 → 0.2.3

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: 8859ae778f1e88395c55b8d31281ccb50f315ea9
4
- data.tar.gz: 32712b243c9970b79f692a105bd9119119a6ddfd
3
+ metadata.gz: c92f08b1a9d787c0bf7547c8b71317478280bbff
4
+ data.tar.gz: e1553241ac3a947e454062fd375d33d0e94ea8ff
5
5
  SHA512:
6
- metadata.gz: 01c3262ae551f2b7276e8def589ae642a7c50032dd2602ccd1475d632737fddc5dbf5db645dfc199bddf772707178dd1c687514b71c5041ab66461760e9c328f
7
- data.tar.gz: e170faa00dad23c3ba9cce1d301169b4d5a45c907e7e97162a294bc2576a3f3d1fb8aff62c7af32ad95bf726d9e019f6cb3433fc655be7db620bc5402ecb1b87
6
+ metadata.gz: fc43efb7a94ba93e0de194ce2a2244c96fb072ae80918bfbd56c521ee756235c0789c61db8c7e3a8ab2b315fdd5705863aaee95fc434ff27feffd3f9b7a1dd99
7
+ data.tar.gz: cd3e6bc1eb5d4233127ce284fdafda5ebca291cfab7f45af1d553825879e3030d4b9f975504fa1f27dda5c95909f2f16916a0a9e8a62e82855120dd168d81e9a
data/README.md CHANGED
@@ -56,6 +56,11 @@ To save on disk space, you can set the compression level. Gzip 0-9 are supported
56
56
  set :postgres_backup_compression_level, 6 # Will use gzip level 6 to compress the output.
57
57
  ```
58
58
 
59
+ If you are using different clusters:
60
+ ```
61
+ set :postgres_remote_cluster, '9.6/main'
62
+ ```
63
+
59
64
  ## Contributing
60
65
 
61
66
  1. Fork it ( http://github.com/spilin/capistrano3-postgres/fork )
@@ -1,5 +1,5 @@
1
1
  module Capistrano3
2
2
  module Postgres
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
@@ -8,6 +8,7 @@ namespace :load do
8
8
  set :postgres_remote_sqlc_file_path, -> { nil }
9
9
  set :postgres_local_database_config, -> { nil }
10
10
  set :postgres_remote_database_config, -> { nil }
11
+ set :postgres_remote_cluster, -> { nil }
11
12
  end
12
13
  end
13
14
 
@@ -23,8 +24,17 @@ namespace :postgres do
23
24
  file_name = "db_backup.#{Time.now.strftime('%Y-%m-%d_%H-%M-%S')}.sqlc"
24
25
  set :postgres_remote_sqlc_file_path, "#{shared_path}/#{fetch(:postgres_backup_dir)}/#{file_name}"
25
26
  end
26
-
27
- execute "PGPASSWORD=#{config['password']} pg_dump #{user_option(config)} -h #{config['host']} -Fc --file=#{fetch(:postgres_remote_sqlc_file_path)} -Z #{fetch(:postgres_backup_compression_level)} #{config['database']}"
27
+ execute [
28
+ "PGPASSWORD=#{config['password']}",
29
+ "pg_dump #{user_option(config)}",
30
+ "-h #{config['host']}",
31
+ config['port'] ? "-p #{config['port']}" : nil,
32
+ "-Fc",
33
+ "--file=#{fetch(:postgres_remote_sqlc_file_path)}",
34
+ "-Z #{fetch(:postgres_backup_compression_level)}",
35
+ fetch(:postgres_remote_cluster) ? "--cluster #{fetch(:postgres_remote_cluster)}" : nil,
36
+ "#{config['database']}"
37
+ ].compact.join(' ')
28
38
  end
29
39
  end
30
40
 
@@ -208,7 +218,7 @@ namespace :postgres do
208
218
  require 'figaro'
209
219
  config = File.expand_path('../config/application.yml', __FILE__)
210
220
 
211
- Figaro.application = Figaro::Application.new(environment: env, path: config)
221
+ Figaro.application = Figaro::Application.new(environment: '#{env}', path: config)
212
222
  Figaro.load
213
223
  rescue LoadError
214
224
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Krasynskyi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.5.1
64
+ rubygems_version: 2.6.10
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Create, download and restore postgres database.