capistrano_multiconfig_parallel 2.0.0.beta1 → 2.0.0.beta2
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 +4 -4
- data/README.md +1 -1
- data/capistrano_multiconfig_parallel.gemspec +1 -1
- data/lib/capistrano_multiconfig_parallel/application.rb +4 -0
- data/lib/capistrano_multiconfig_parallel/classes/job.rb +9 -10
- data/lib/capistrano_multiconfig_parallel/classes/job_command.rb +33 -15
- data/lib/capistrano_multiconfig_parallel/helpers/gem_helper.rb +1 -1
- data/lib/capistrano_multiconfig_parallel/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c04e56d6d029d5babb6f06674b3c9fcfd91501ee
|
4
|
+
data.tar.gz: 16fad70a3ab6d90fab9ed087bd37c7d178304629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63c3cc0eefeb79386904d68d0c265385b772178cb0be0a4590518e69f4358fd75e06c8037bd2fea296b6dd3a6b4f5990be42c21a9c0c3863f87166f9fff8b312
|
7
|
+
data.tar.gz: f3dd4b27a7be10068b1a15b770fb37b17c44995d72ffd1ce143828586c2e857369206c1fabb7e136f3351753221fbfde533e7566cbdca7d1ccf3a95ebbd4de13
|
data/README.md
CHANGED
@@ -76,7 +76,7 @@ Add the following to your Capfile after requiring **capistrano** and **capistran
|
|
76
76
|
Install locally on your system the capistrano_multiconfig_parallel gem using this command :
|
77
77
|
|
78
78
|
```ruby
|
79
|
-
gem install capistrano_multiconfig_parallel -v 2.0.0.
|
79
|
+
gem install capistrano_multiconfig_parallel -v 2.0.0.beta1
|
80
80
|
```
|
81
81
|
|
82
82
|
Please read [Release Details](https://github.com/bogdanRada/capistrano_multiconfig_parallel/releases) if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes.
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_runtime_dependency 'configliere', '~> 0.4', '>=0.4'
|
30
30
|
s.add_runtime_dependency 'inquirer', '~> 0.2', '>= 0.2'
|
31
31
|
s.add_runtime_dependency 'devnull','~> 0.1', '>= 0.1'
|
32
|
-
s.add_runtime_dependency 'capistrano_sentinel', '>= 0.0', '>= 0.0.
|
32
|
+
s.add_runtime_dependency 'capistrano_sentinel', '>= 0.0', '>= 0.0.16'
|
33
33
|
|
34
34
|
s.add_development_dependency 'rake', '>= 10.4', '>= 10.4'
|
35
35
|
s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4'
|
@@ -220,6 +220,10 @@ module CapistranoMulticonfigParallel
|
|
220
220
|
path: options.fetch('path', nil)
|
221
221
|
|
222
222
|
))
|
223
|
+
|
224
|
+
unless job.capistrano_sentinel_needs_updating?
|
225
|
+
raise "Please consider upgrading the gem #{job.capistrano_sentinel_name} to version #{job.loaded_capistrano_sentinel_version} from #{job.job_capistrano_sentinel_version} in #{job.job_path} "
|
226
|
+
end
|
223
227
|
@jobs << job unless job_can_tag_staging?(job)
|
224
228
|
end
|
225
229
|
|
@@ -8,16 +8,6 @@ module CapistranoMulticonfigParallel
|
|
8
8
|
attr_reader :options, :application, :manager, :bundler_status
|
9
9
|
attr_writer :status, :exit_status, :bundler_status
|
10
10
|
|
11
|
-
delegate :job_stage,
|
12
|
-
:capistrano_action,
|
13
|
-
:execute_standard_deploy,
|
14
|
-
:setup_command_line,
|
15
|
-
:job_capistrano_version,
|
16
|
-
:gem_specs,
|
17
|
-
:job_stage_for_terminal,
|
18
|
-
:rollback_changes_to_application,
|
19
|
-
to: :command
|
20
|
-
|
21
11
|
delegate :stderr_buffer,
|
22
12
|
to: :manager
|
23
13
|
|
@@ -164,5 +154,14 @@ module CapistranoMulticonfigParallel
|
|
164
154
|
end
|
165
155
|
hash
|
166
156
|
end
|
157
|
+
|
158
|
+
def method_missing(sym, *args, &block)
|
159
|
+
command.public_send(sym, *args, &block)
|
160
|
+
end
|
161
|
+
|
162
|
+
def respond_to_missing?(method_name, include_private = false)
|
163
|
+
command.public_methods.include?(method_name) || super
|
164
|
+
end
|
165
|
+
|
167
166
|
end
|
168
167
|
end
|
@@ -6,11 +6,12 @@ module CapistranoMulticonfigParallel
|
|
6
6
|
include FileUtils
|
7
7
|
include CapistranoMulticonfigParallel::ApplicationHelper
|
8
8
|
|
9
|
-
attr_reader :job, :job_capistrano_version, :legacy_capistrano, :tempfile
|
9
|
+
attr_reader :job, :job_capistrano_version, :legacy_capistrano, :tempfile, :job_final_gemfile
|
10
10
|
delegate :id, :app, :stage, :action, :task_arguments, :env_options, :path, to: :job
|
11
11
|
|
12
12
|
def initialize(job)
|
13
13
|
@job = job
|
14
|
+
@job_final_gemfile = job_gemfile_multi
|
14
15
|
@legacy_capistrano = legacy_capistrano? ? true : false
|
15
16
|
end
|
16
17
|
|
@@ -53,15 +54,23 @@ module CapistranoMulticonfigParallel
|
|
53
54
|
gitflow_version.present? ? true : false
|
54
55
|
end
|
55
56
|
|
56
|
-
def
|
57
|
+
def capistrano_sentinel_name
|
57
58
|
"capistrano_sentinel"
|
58
59
|
end
|
59
60
|
|
60
|
-
def
|
61
|
-
gitflow_version = job_gem_version(
|
61
|
+
def capistrano_sentinel_available?
|
62
|
+
gitflow_version = job_gem_version(capistrano_sentinel_name)
|
62
63
|
gitflow_version.present? ? true : false
|
63
64
|
end
|
64
65
|
|
66
|
+
def loaded_capistrano_sentinel_version
|
67
|
+
find_loaded_gem_property(capistrano_sentinel_name)
|
68
|
+
end
|
69
|
+
|
70
|
+
def job_capistrano_sentinel_version
|
71
|
+
job_gem_version(capistrano_sentinel_name)
|
72
|
+
end
|
73
|
+
|
65
74
|
def job_stage_for_terminal
|
66
75
|
app.present? ? "#{app}:#{stage}" : "#{stage}"
|
67
76
|
end
|
@@ -106,6 +115,15 @@ module CapistranoMulticonfigParallel
|
|
106
115
|
verify_gem_version(job_capistrano_version, '3.0', operator: '<')
|
107
116
|
end
|
108
117
|
|
118
|
+
def capistrano_sentinel_needs_updating?
|
119
|
+
if capistrano_sentinel_available?
|
120
|
+
loaded_capistrano_sentinel_version == job_capistrano_sentinel_version
|
121
|
+
else
|
122
|
+
# the capistrano_sentinel is not part of the Gemfile so no need checking if needs updating
|
123
|
+
true
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
109
127
|
def job_path
|
110
128
|
path || detect_root
|
111
129
|
end
|
@@ -158,7 +176,7 @@ module CapistranoMulticonfigParallel
|
|
158
176
|
def fetch_deploy_command
|
159
177
|
# config_flags = CapistranoMulticonfigParallel.configuration_flags.merge("capistrano_version": job_capistrano_version)
|
160
178
|
environment_options = setup_command_line.join(' ')
|
161
|
-
command = "#{check_rvm_loaded} && if [ `which bundler |wc -l` = 0 ]; then gem install bundler;fi && (#{bundle_gemfile_env(
|
179
|
+
command = "#{check_rvm_loaded} && if [ `which bundler |wc -l` = 0 ]; then gem install bundler;fi && (#{bundle_gemfile_env(@job_final_gemfile)} bundle check || #{bundle_gemfile_env(@job_final_gemfile)} bundle install ) && WEBSOCKET_LOGGING=#{debug_websocket?} LOG_FILE=#{websocket_config.fetch('log_file_path', nil)} #{bundle_gemfile_env(@job_final_gemfile)} bundle exec cap #{job_stage} #{capistrano_action} #{environment_options}"
|
162
180
|
|
163
181
|
command = "bash --login -c '#{command}'" if rvm_enabled_for_job?
|
164
182
|
command = command.inspect
|
@@ -193,22 +211,22 @@ module CapistranoMulticonfigParallel
|
|
193
211
|
end
|
194
212
|
|
195
213
|
def prepare_application_for_deployment
|
196
|
-
|
214
|
+
check_capistrano_sentinel_availability
|
197
215
|
prepare_capfile
|
198
216
|
end
|
199
217
|
|
200
|
-
def
|
201
|
-
# '#{find_loaded_gem_property(
|
218
|
+
def check_capistrano_sentinel_availability
|
219
|
+
# '#{find_loaded_gem_property(capistrano_sentinel_name)}'
|
202
220
|
# path: '/home/raul/workspace/github/capistrano_sentinel'
|
203
221
|
FileUtils.rm_rf(job_gemfile_multi) if File.exists?(job_gemfile_multi)
|
204
222
|
FileUtils.touch(job_gemfile_multi)
|
205
|
-
if
|
206
|
-
|
223
|
+
if capistrano_sentinel_available? && capistrano_sentinel_needs_updating?
|
224
|
+
@job_final_gemfile = job_gemfile
|
207
225
|
else
|
208
226
|
File.open(job_gemfile_multi, 'w') do |f|
|
209
227
|
cmd=<<-CMD
|
210
228
|
source "https://rubygems.org" do
|
211
|
-
gem "#{
|
229
|
+
gem "#{capistrano_sentinel_name}", '#{find_loaded_gem_property(capistrano_sentinel_name)}'
|
212
230
|
end
|
213
231
|
instance_eval(File.read(File.dirname(__FILE__) + "/Gemfile"))
|
214
232
|
CMD
|
@@ -219,10 +237,10 @@ module CapistranoMulticonfigParallel
|
|
219
237
|
end
|
220
238
|
|
221
239
|
def prepare_capfile
|
222
|
-
return if File.foreach(job_capfile).grep(/#{
|
240
|
+
return if File.foreach(job_capfile).grep(/#{capistrano_sentinel_name}/).any?
|
223
241
|
File.open(job_capfile, 'a+') do |f|
|
224
242
|
cmd=<<-CMD
|
225
|
-
require "#{
|
243
|
+
require "#{capistrano_sentinel_name}"
|
226
244
|
CMD
|
227
245
|
f.write(cmd)
|
228
246
|
end
|
@@ -232,11 +250,11 @@ module CapistranoMulticonfigParallel
|
|
232
250
|
def rollback_changes_to_application
|
233
251
|
FileUtils.rm_rf(job_gemfile_multi)
|
234
252
|
FileUtils.rm_rf("#{job_gemfile_multi}.lock")
|
235
|
-
unless
|
253
|
+
unless capistrano_sentinel_available?
|
236
254
|
File.open(job_capfile, 'r') do |f|
|
237
255
|
File.open("#{job_capfile}.tmp", 'w') do |f2|
|
238
256
|
f.each_line do |line|
|
239
|
-
f2.write(line) unless line.include?(
|
257
|
+
f2.write(line) unless line.include?(capistrano_sentinel_name)
|
240
258
|
end
|
241
259
|
end
|
242
260
|
end
|
@@ -5,7 +5,7 @@ module CapistranoMulticonfigParallel
|
|
5
5
|
|
6
6
|
def find_loaded_gem(name, property = nil)
|
7
7
|
gem_spec = Gem.loaded_specs.values.find { |repo| repo.name == name }
|
8
|
-
gem_spec.present? && property.present? ? gem_spec.send(property) : gem_spec
|
8
|
+
gem_spec.present? && property.present? ? gem_spec.send(property).to_s : gem_spec
|
9
9
|
end
|
10
10
|
|
11
11
|
def find_loaded_gem_property(gem_name, property = 'version')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano_multiconfig_parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|
@@ -247,7 +247,7 @@ dependencies:
|
|
247
247
|
version: '0.0'
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version: 0.0.
|
250
|
+
version: 0.0.16
|
251
251
|
type: :runtime
|
252
252
|
prerelease: false
|
253
253
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -257,7 +257,7 @@ dependencies:
|
|
257
257
|
version: '0.0'
|
258
258
|
- - ">="
|
259
259
|
- !ruby/object:Gem::Version
|
260
|
-
version: 0.0.
|
260
|
+
version: 0.0.16
|
261
261
|
- !ruby/object:Gem::Dependency
|
262
262
|
name: rake
|
263
263
|
requirement: !ruby/object:Gem::Requirement
|
@@ -527,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
527
527
|
version: 1.3.1
|
528
528
|
requirements: []
|
529
529
|
rubyforge_project:
|
530
|
-
rubygems_version: 2.
|
530
|
+
rubygems_version: 2.5.1
|
531
531
|
signing_key:
|
532
532
|
specification_version: 4
|
533
533
|
summary: CapistranoMulticonfigParallel is a simple ruby implementation that allows
|