luban 0.10.11 → 0.10.12

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: 15735d9866abfcc5251bd710d1ebfc903f551633
4
- data.tar.gz: 799e57170781788c026441f52622793697e298dc
3
+ metadata.gz: a924165b2113623369909886a8015a8f9fd95b05
4
+ data.tar.gz: 5a3f867b852f14805773d078d09a4f80d13b2f00
5
5
  SHA512:
6
- metadata.gz: b895b3455c3f73c2e85dafb5c7da126cb7f37efb51eb8436e85d0a59ea0df102eb7d65d2b5467f4793cc139c8689dd23a9cafcac7cf02a511b2b799605368464
7
- data.tar.gz: 32f9b991d2cdabefad3e17732dbd83f8abd6c209204d83e909eb6004854becb5f765e72921fbebed65c39985e03b968827166eb2dc2b525aa03c5d802f91f288
6
+ metadata.gz: f411ea9e3143774c87f99744a70bce7183ed4d63f1f069e327ce1dae2a222538dd5e952a355d0456847eadbb98c89f90940333c0f2de93646b856083b93b5574
7
+ data.tar.gz: 01d57bd9b4d2941703416ce32a4434a1d7cb12322932a7d00868f93c6e5dd43466de1fd9d1a1ac39b4ea70aaeba277ceb462613eff8fc261f46fa59ff211aaae
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.10.12 (Dec 14, 2016)
4
+
5
+ Minor enhancements:
6
+ * Added a host property, :local, to indicate if the host is a localhost
7
+ * If local host property is not set, hostname lookup will be carried out to check if the given hostname is a local host
8
+ * Added a general parameter, :skip_promptless_authen, to skip promptless authenticaiton setup
9
+ * By default, :skip_promptless_authen is turned off
10
+ * Skipped prompltess authentication setup for local host
11
+
3
12
  ## Version 0.10.11 (Dec 01, 2016)
4
13
 
5
14
  Minor enhancements:
@@ -56,7 +56,10 @@ module Luban
56
56
  def app; task.opts.app; end
57
57
 
58
58
  def promptless_authen
59
- if promptless_authen_enabled?
59
+ if host.local?
60
+ update_result "Skipped! Promptless authentication is not necessary for local host.",
61
+ status: :skipped
62
+ elsif promptless_authen_enabled?
60
63
  update_result "Skipped! Promptless authentication has been enabled ALREADY.",
61
64
  status: :skipped, public_key: public_key
62
65
  else
@@ -139,7 +139,7 @@ module Luban
139
139
 
140
140
  def promptless_authen(args:, opts:)
141
141
  opts = opts.merge(app: self, public_keys: Array(public_key!(args: args, opts: opts)))
142
- public_keys = promptless_authen!(args: args, opts: opts).collect { |r| r[:public_key] }
142
+ public_keys = promptless_authen!(args: args, opts: opts).collect { |r| r[:public_key] }.compact
143
143
 
144
144
  opts[:roles] = []
145
145
  opts[:roles] << scm_role unless scm_role.nil?
@@ -156,7 +156,7 @@ module Luban
156
156
 
157
157
  def setup(args:, opts:)
158
158
  show_app_environment
159
- promptless_authen(args: args, opts: opts)
159
+ promptless_authen(args: args, opts: opts) unless skip_promptless_authen
160
160
  setup!(args: args, opts: opts)
161
161
  end
162
162
  dispatch_task :setup!, to: :constructor, as: :setup
@@ -13,6 +13,7 @@ module Luban
13
13
  def setup
14
14
  bootstrap
15
15
  create_envrc_files
16
+ update_result "Application environment is setup successfully."
16
17
  end
17
18
 
18
19
  def destroy
@@ -356,8 +356,8 @@ module Luban
356
356
 
357
357
  def set_parameters
358
358
  copy_parameters_from_parent(
359
- :luban_roles, :luban_root_path, :user,
360
- :stages, :applications, :work_dir, :apps_path
359
+ :luban_roles, :luban_root_path, :work_dir, :apps_path,
360
+ :stages, :applications, :user, :skip_promptless_authen
361
361
  )
362
362
  end
363
363
 
@@ -13,6 +13,14 @@ module Luban
13
13
  server
14
14
  end
15
15
 
16
+ def local?
17
+ super or (properties.has_key?(:local) ? properties[:local] : localhost?)
18
+ end
19
+
20
+ def localhost?
21
+ hostname == 'localhost' or hostname == `hostname -f`.chomp
22
+ end
23
+
16
24
  def roles
17
25
  self[:roles]
18
26
  end
@@ -39,6 +39,8 @@ module Luban
39
39
  parameter :user, default: ENV['USER']
40
40
  parameter :config_finder, default: ->{ Hash.new }
41
41
 
42
+ parameter :skip_promptless_authen, default: false
43
+
42
44
  protected
43
45
 
44
46
  def validate_for_user
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.10.11"
3
+ VERSION = "0.10.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.11
4
+ version: 0.10.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Lei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli