yyuu-capistrano-chef-solo 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  require "capistrano-chef-solo/version"
2
2
  require "capistrano-rbenv"
3
3
  require "capistrano/configuration"
4
+ require "capistrano/errors"
4
5
  require "capistrano/recipes/deploy/scm"
5
6
  require "json"
6
7
  require "uri"
@@ -80,10 +81,10 @@ module Capistrano
80
81
  set(:_chef_solo_bootstrap_ssh_options, fetch(:ssh_options))
81
82
  # we have to establish connections before teardown.
82
83
  # https://github.com/capistrano/capistrano/pull/416
83
- establish_connections_to(servers)
84
+ establish_connections_to(servers) rescue nil
84
85
  logger.info("entering chef-solo bootstrap mode. reconnect to servers as `#{chef_solo_bootstrap_user}'.")
85
86
  # drop connection which is connected as standard :user.
86
- teardown_connections_to(servers)
87
+ teardown_connections_to(servers) rescue nil
87
88
  set(:user, chef_solo_bootstrap_user)
88
89
  set(:password, chef_solo_bootstrap_password) if chef_solo_use_password
89
90
  set(:ssh_options, chef_solo_bootstrap_ssh_options)
@@ -100,10 +101,10 @@ module Capistrano
100
101
  set(:_chef_solo_bootstrapped, false)
101
102
  # we have to establish connections before teardown.
102
103
  # https://github.com/capistrano/capistrano/pull/416
103
- establish_connections_to(servers)
104
+ establish_connections_to(servers) rescue nil
104
105
  logger.info("leaving chef-solo bootstrap mode. reconnect to servers as `#{user}'.")
105
106
  # drop connection which is connected as bootstrap :user.
106
- teardown_connections_to(servers)
107
+ teardown_connections_to(servers) rescue nil
107
108
  true
108
109
  else
109
110
  false
@@ -118,7 +119,7 @@ module Capistrano
118
119
  begin
119
120
  activated = _activate_settings(servers)
120
121
  yield
121
- rescue => error
122
+ rescue Capistrano::ConnectionError => error
122
123
  logger.info("could not connect with bootstrap settings: #{error}")
123
124
  raise
124
125
  ensure
@@ -456,8 +457,8 @@ module Capistrano
456
457
  # (lazy variables might have any side-effects)
457
458
  #
458
459
  attributes = variables.reject { |key, value|
459
- excluded = chef_solo_capistrano_attributes_exclude.include?(key)
460
- included = chef_solo_capistrano_attributes_include.include?(key)
460
+ excluded = chef_solo_capistrano_attributes_exclude.find { |x| x === key }
461
+ included = chef_solo_capistrano_attributes_include.find { |x| x === key }
461
462
  excluded or (not included and value.respond_to?(:call))
462
463
  }
463
464
  Hash[attributes.map { |key, value| [key, fetch(key, nil)] }]
@@ -466,7 +467,7 @@ module Capistrano
466
467
  :application, :deploy_to, :rails_env, :latest_release,
467
468
  :releases_path, :shared_path, :current_path, :release_path,
468
469
  ])
469
- _cset(:chef_solo_capistrano_attributes_exclude, [:logger, :password])
470
+ _cset(:chef_solo_capistrano_attributes_exclude, [:logger, /password/, :source, :strategy])
470
471
  _cset(:chef_solo_attributes, {})
471
472
  _cset(:chef_solo_host_attributes, {})
472
473
  _cset(:chef_solo_role_attributes, {})
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module ChefSolo
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yyuu-capistrano-chef-solo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
12
+ date: 2013-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano