capistrano_multiconfig_parallel 0.16.0 → 0.16.1

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: 3ce2dc9cdc3056f52c0f0f06facbc8208eb341a8
4
- data.tar.gz: f014527c0c1545dd27d0561bb2188df5816a6eaf
3
+ metadata.gz: d46ff24b24d18247e1ea920d37ce383734ffa3bc
4
+ data.tar.gz: bf1581316694c05421159ab06874ec929a6dd122
5
5
  SHA512:
6
- metadata.gz: 3749cf237d9070a98da9ddf7b7b939b23d440b7edb318fd1dd26c227d3c47b04fd7738c9e5251e459cb7ac73fed714783cf1ea7e66a07309684cc0ff6f8667a0
7
- data.tar.gz: 67b528fcfcecf9a5ac5a87f85a22e9cd4467a0ce47ed421f1587ea3167e0882784e035c05c0a71998d0de1f14658a7995459bd46dc4ee4f729cf07076bbc6093
6
+ metadata.gz: 1e4abbd36a6096db020e255cb31548f39f8a8ce542f875cc04ca02bc1c530ebafe38df72738b2563832814cf1dcd4d4249582377ba695d2a14b050b4c2141266
7
+ data.tar.gz: bc9d444a27c396acb3080f4251649b0a934c5530aad42df6ec097342c9542015293556e8b61028231c0b926bdfe8a4f28ce6eca7d74e4bc13f89199599f56756
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano_multiconfig_parallel (0.15.5)
4
+ capistrano_multiconfig_parallel (0.16.0)
5
5
  activesupport (~> 4.0, >= 4.0)
6
6
  capistrano (~> 3.0, >= 3.0)
7
7
  celluloid-pmap (~> 0.2, >= 0.2.2)
@@ -35,18 +35,3 @@ require_relative './version'
35
35
  require_relative './configuration'
36
36
  require_relative './base'
37
37
  require_relative './application'
38
-
39
- # Signal.trap("TERM") do
40
- # puts'aa'
41
- # CapistranoMulticonfigParallel::Application.terminate
42
- # end
43
- #
44
- # Signal.trap('USR1') do
45
- # puts'aaaa3'
46
- # CapistranoMulticonfigParallel::Application.terminate
47
- # end
48
- #
49
- # Signal.trap('USR2') do
50
- # puts'aaaa3'
51
- # CapistranoMulticonfigParallel::Application.terminate
52
- # end
@@ -8,11 +8,11 @@ module CapistranoMulticonfigParallel
8
8
  attr_accessor :stages,:stage_apps, :top_level_tasks, :jobs, :branch_backup, :condition, :manager, :dependency_tracker, :application, :stage, :name, :args, :argv, :default_stage
9
9
 
10
10
  def initialize
11
+ Celluloid.boot
11
12
  @stages = fetch_stages
12
13
  @stage_apps = multi_apps? ? @stages.map { |stage| stage.split(':').reverse[1] }.uniq : []
13
14
  collect_command_line_tasks(CapistranoMulticonfigParallel.original_args)
14
15
  @jobs = []
15
- CapistranoMulticonfigParallel.configuration_valid?(@stages)
16
16
  end
17
17
 
18
18
 
@@ -78,9 +78,6 @@ module CapistranoMulticonfigParallel
78
78
  @argv['BRANCH'] = nil
79
79
  end
80
80
 
81
- def can_start?
82
- @top_level_tasks.size >= 1 && (@stages.include?(@top_level_tasks.first) || custom_command?) && @argv[CapistranoMulticonfigParallel::ENV_KEY_JOB_ID].blank?
83
- end
84
81
 
85
82
  def custom_command?
86
83
  if multi_apps?
@@ -10,7 +10,7 @@ module CapistranoMulticonfigParallel
10
10
 
11
11
  cattr_accessor :debug_enabled
12
12
 
13
- attr_accessor :jobs, :job_to_worker, :worker_to_job, :actor_system, :job_to_condition, :mutex, :registration_complete, :workers_terminated
13
+ attr_accessor :jobs, :job_to_worker, :worker_to_job, :job_to_condition, :mutex, :registration_complete, :workers_terminated
14
14
 
15
15
  attr_reader :worker_supervisor, :workers
16
16
  trap_exit :worker_died
@@ -21,7 +21,6 @@ module CapistranoMulticonfigParallel
21
21
  @job_manager = job_manager
22
22
  @registration_complete = false
23
23
  # Get a handle on the SupervisionGroup::Member
24
- @actor_system = Celluloid.boot
25
24
  @mutex = Mutex.new
26
25
  # http://rubydoc.info/gems/celluloid/Celluloid/SupervisionGroup/Member
27
26
  @workers = @worker_supervisor.pool(CapistranoMulticonfigParallel::CelluloidWorker, as: :workers, size: 10)
@@ -7,8 +7,9 @@ module CapistranoMulticonfigParallel
7
7
  def self.start
8
8
  CapistranoMulticonfigParallel.check_terminal_tty
9
9
  CapistranoMulticonfigParallel.original_args = ARGV.dup
10
+ CapistranoMulticonfigParallel.configuration_valid?
10
11
  job_manager = CapistranoMulticonfigParallel::Application.new
11
- if job_manager.can_start?
12
+ if job_manager.argv[CapistranoMulticonfigParallel::ENV_KEY_JOB_ID].blank?
12
13
  job_manager.start
13
14
  else
14
15
  Capistrano::Application.new.run
@@ -7,23 +7,30 @@ module CapistranoMulticonfigParallel
7
7
  attr_accessor :configuration
8
8
 
9
9
  def configuration
10
- @config ||= Configliere::Param.new
10
+ @config ||= fetch_configuration
11
+ @config
12
+ end
13
+
14
+
15
+ def fetch_configuration
16
+ @fetched_config = Configliere::Param.new
11
17
  command_line_params.each do |param|
12
18
  param_type = change_config_type(param['type'].to_s)
13
- @config.define param['name'], type: param_type, description: param['description'], default: param['default']
19
+ @fetched_config.define param['name'], type: param_type, description: param['description'], default: param['default']
14
20
  end
15
21
 
16
22
  ARGV.clear
17
23
 
18
24
  CapistranoMulticonfigParallel.original_args.each { |a| ARGV << a }
19
- @config.read config_file if File.file?(config_file)
20
- @config.use :commandline
25
+ @fetched_config.read config_file if File.file?(config_file)
26
+ @fetched_config.use :commandline
21
27
 
22
- @config.use :config_block
23
- @config.finally do |c|
28
+ @fetched_config.use :config_block
29
+ @fetched_config.finally do |c|
24
30
  check_configuration(c)
25
31
  end
26
- @config.resolve!
32
+ @fetched_config.process_argv!
33
+ @fetched_config.resolve!
27
34
  end
28
35
 
29
36
  def config_file
@@ -71,7 +78,7 @@ module CapistranoMulticonfigParallel
71
78
  raise ArgumentError, "the property `#{prop}` must be boolean" unless %w(true false).include?(c[prop].to_s.downcase)
72
79
  end
73
80
 
74
- def configuration_valid?(stages)
81
+ def configuration_valid?
75
82
  configuration
76
83
  end
77
84
 
@@ -8,7 +8,7 @@ module CapistranoMulticonfigParallel
8
8
  module VERSION
9
9
  MAJOR = 0
10
10
  MINOR = 16
11
- TINY = 0
11
+ TINY = 1
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_multiconfig_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
@@ -637,7 +637,6 @@ files:
637
637
  - lib/capistrano_multiconfig_parallel/helpers/output_stream.rb
638
638
  - lib/capistrano_multiconfig_parallel/helpers/rake_hook_actor.rb
639
639
  - lib/capistrano_multiconfig_parallel/helpers/standard_deploy.rb
640
- - lib/capistrano_multiconfig_parallel/initializers/conf.rb
641
640
  - lib/capistrano_multiconfig_parallel/initializers/default.yml
642
641
  - lib/capistrano_multiconfig_parallel/version.rb
643
642
  homepage: http://github.com/bogdanRada/capistrano_multiconfig_parallel/
@@ -1,12 +0,0 @@
1
- require 'configliere/commandline'
2
- Configliere::Commandline.class_eval do
3
- def resolve!(print_help_and_exit = true)
4
- process_argv!
5
- if print_help_and_exit && self[:help]
6
- dump_help
7
- # exit(2)
8
- end
9
- super()
10
- self
11
- end
12
- end