capistrano3-pushr 1.0.0 → 1.0.1

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: 321427436b3d2e2bd3edbd7842db5889764a59a6
4
- data.tar.gz: 696848033b90b43799f70a44c46aa9e82e7c6e72
3
+ metadata.gz: 3432dfb52d8f11cc07689bdb65e66b6decd49820
4
+ data.tar.gz: b2d66c54b3b98ca5793a92b4299c13bd56289584
5
5
  SHA512:
6
- metadata.gz: bba2dbd43f3f260a9a61db9544d4f5fc70200bd05847b856179cf0b578a24eee59f16ac848c634748a8ff562628ad8b7d762610e5ac8d2dbfabddf55443da332
7
- data.tar.gz: 395fb13d7f00767e122d73f5200a62b4c2548d14e14c361ca8eabfba55d790c3c017bdcb2184ad26a80aa4e9272d63147a455407d99bff40734037c61e52f7b2
6
+ metadata.gz: 1b7f06642c8c6fd179b2ba691d9722ac7a77e9051f3b4a694d991e5d0cf8bcd6a50e3259c12776be2beed59c4f3e4862040880bcd0deae3a80ec5006b153e717
7
+ data.tar.gz: 61af1c1a4deda8451cfefb6efd09c0a35f3d4f99d811b3481bc34d4c45a06d16a784e95e34fc24fc89c97a59561892618ebbb35341ff375627aba127a5830295
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Pushr
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -3,6 +3,11 @@ namespace :load do
3
3
  set :pushr_default_hooks, -> { true }
4
4
 
5
5
  set :pushr_pid, -> { File.join shared_path, 'tmp', 'pids', 'pushr.pid' }
6
+ set :pushr_configuration, -> { File.join shared_path, 'config', 'pushr.yml' }
7
+ set :pushr_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
8
+ set :pushr_redis_host, -> { fetch(:redis_host, 'localhost') }
9
+ set :pushr_redis_port, -> { fetch(:redis_port, '6379') }
10
+ set :pushr_redis_namespace, -> { fetch(:redis_namespace, "pushr_#{fetch(:application)}_#{fetch(:stage)}") }
6
11
  end
7
12
  end
8
13
 
@@ -77,16 +82,16 @@ namespace :pushr do
77
82
  "cat #{fetch(:pushr_pid)}"
78
83
  end
79
84
 
80
- def pid_file_exists?
85
+ def pushr_pid_file_exists?
81
86
  test(*("[ -f #{fetch(:pushr_pid)} ]").split(' '))
82
87
  end
83
88
 
84
- def pid_process_exists?
85
- pid_file_exists? && test(*("kill -0 `#{pid_command}`").split(' '))
89
+ def pushr_pid_process_exists?
90
+ pushr_pid_file_exists? && test(*("kill -0 `#{pid_command}`").split(' '))
86
91
  end
87
92
 
88
93
  def stop_pushr(signal)
89
- return unless test("[ -d #{release_path} ]") && pid_process_exists?
94
+ return unless test("[ -d #{release_path} ]") && pushr_pid_process_exists?
90
95
 
91
96
  within release_path do
92
97
  puts 'Stopping Pushr...'
@@ -97,8 +102,17 @@ namespace :pushr do
97
102
 
98
103
  def start_pushr
99
104
  within release_path do
105
+ args = []
106
+ args.push "--pid-file #{fetch(:pushr_pid)}"
107
+ args.push "--configuration #{fetch(:pushr_configuration)}"
108
+ args.push "--redis-host #{fetch(:pushr_redis_host)}"
109
+ args.push "--redis-port #{fetch(:pushr_redis_port)}"
110
+ args.push "--redis-namespace #{fetch(:pushr_redis_namespace)}"
111
+
100
112
  puts 'Starting Pushr...'
101
- execute 'bundle', 'exec', 'pushr', '--pid-file', fetch(:pushr_pid)
113
+ with rack_env: fetch(:pushr_env) do
114
+ execute 'bundle', 'exec', 'pushr', args.compact.join(' ')
115
+ end
102
116
  puts 'done!'
103
117
  end
104
118
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-pushr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zsofia Balogh