kdeploy 1.2.0 → 1.2.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
  SHA256:
3
- metadata.gz: 9574b9c52313e673d2399743267152b6c551f00b05f4aa838fe9bda710621c98
4
- data.tar.gz: f955c897863c2f8578c652c61cbcca832fd8c771cced70a57bdf421ed0bbad7a
3
+ metadata.gz: d8190b20e37d5dcf26ea9834e8ccf2f2a9b9c396dd44a48b294e7d0c643bdcd8
4
+ data.tar.gz: 0af02ac4d1fbb6c76983e30841ec6940d9fb8539a3e642095cc305f108b94eae
5
5
  SHA512:
6
- metadata.gz: 451d63382d7219d4e3dfcb747656e5eace5138e5cbe89add3ba1fea0e4fad8fc19dbb1e863327c6956de00258735c25011af135a9c51208bdf74dcb0fe9019b3
7
- data.tar.gz: 7f7d68333eba156e839ca098d80ed803c48e5cca04daefa77c5c7bb61173d7ffa84f17db8d4d75e4c68b13a1d8d52c8c9bce47aa560327d61e070db887e0f927
6
+ metadata.gz: 468ff349e53c460a39e5bd0553dab1ed747c9038fb319ff0e2e4f6ad6d5bdb766e3e6a2072b6ba4ac06b6d78967ba7e3f2955e984bbac21f1fc7431fde3df6c4
7
+ data.tar.gz: 6f5bb7bf536f1945dec267c6a816de9f29f1bdc1dea8a43e8b103f3e670f274c9f998a435308492f2fc56850cc81cc88b868982eb9447b06f35bed9f32aa08e7
@@ -3,6 +3,7 @@
3
3
  require 'pastel'
4
4
 
5
5
  module Kdeploy
6
+ # Banner display module for CLI output
6
7
  module Banner
7
8
  class << self
8
9
  def show
data/lib/kdeploy/cli.rb CHANGED
@@ -7,6 +7,7 @@ require 'tty-box'
7
7
  require 'fileutils'
8
8
 
9
9
  module Kdeploy
10
+ # Command-line interface for Kdeploy
10
11
  class CLI < Thor
11
12
  extend DSL
12
13
 
@@ -204,7 +205,7 @@ module Kdeploy
204
205
  next if shown[key]
205
206
 
206
207
  shown[key] = true
207
- duration_str = step[:duration] ? pastel.dim(" [#{'%.2f' % step[:duration]}s]") : ''
208
+ duration_str = step[:duration] ? pastel.dim(" [#{format('%.2f', step[:duration])}s]") : ''
208
209
  puts pastel.green(" [upload] #{step[:command].sub('upload: ', '')}#{duration_str}")
209
210
  end
210
211
  when :upload_template
@@ -214,7 +215,7 @@ module Kdeploy
214
215
  next if shown[key]
215
216
 
216
217
  shown[key] = true
217
- duration_str = step[:duration] ? pastel.dim(" [#{'%.2f' % step[:duration]}s]") : ''
218
+ duration_str = step[:duration] ? pastel.dim(" [#{format('%.2f', step[:duration])}s]") : ''
218
219
  puts pastel.yellow(" [template] #{step[:command].sub('upload_template: ', '')}#{duration_str}")
219
220
  end
220
221
  when :run
@@ -224,7 +225,7 @@ module Kdeploy
224
225
  next if shown[key]
225
226
 
226
227
  shown[key] = true
227
- duration_str = step[:duration] ? pastel.dim(" [#{'%.2f' % step[:duration]}s]") : ''
228
+ duration_str = step[:duration] ? pastel.dim(" [#{format('%.2f', step[:duration])}s]") : ''
228
229
  puts pastel.cyan(" [run] #{step[:command].to_s.lines.first.strip}#{duration_str}")
229
230
  # 多行命令内容高亮
230
231
  cmd_lines = step[:command].to_s.lines[1..].map(&:strip).reject(&:empty?)
@@ -11,12 +11,10 @@ module Kdeploy
11
11
 
12
12
  def self.group_key_for(cmd)
13
13
  case cmd[:type]
14
- when :upload
14
+ when :upload, :upload_template
15
15
  "#{cmd[:type]}_#{cmd[:source]}"
16
16
  when :run
17
17
  "#{cmd[:type]}_#{cmd[:command].to_s.lines.first.strip}"
18
- when :upload_template
19
- "#{cmd[:type]}_#{cmd[:source]}"
20
18
  else
21
19
  cmd[:type].to_s
22
20
  end
data/lib/kdeploy/dsl.rb CHANGED
@@ -70,8 +70,8 @@ module Kdeploy
70
70
  }
71
71
  end
72
72
 
73
- def inventory(&)
74
- instance_eval(&) if block_given?
73
+ def inventory(&block)
74
+ instance_eval(&block) if block_given?
75
75
  end
76
76
 
77
77
  def get_task_hosts(task_name)
@@ -4,6 +4,7 @@ require 'net/ssh'
4
4
  require 'net/scp'
5
5
 
6
6
  module Kdeploy
7
+ # SSH/SCP executor for remote command execution and file operations
7
8
  class Executor
8
9
  def initialize(host_config)
9
10
  @host = host_config[:name]
@@ -3,6 +3,7 @@
3
3
  require 'fileutils'
4
4
 
5
5
  module Kdeploy
6
+ # Project initializer for creating new deployment projects
6
7
  class Initializer
7
8
  def initialize(target_dir = '.')
8
9
  @target_dir = File.expand_path(target_dir)
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
+ # Post-installation configuration handler
4
5
  class PostInstall
5
6
  class << self
6
7
  def run
@@ -3,6 +3,7 @@
3
3
  require 'concurrent'
4
4
 
5
5
  module Kdeploy
6
+ # Concurrent task runner for executing tasks across multiple hosts
6
7
  class Runner
7
8
  def initialize(hosts, tasks, parallel: Configuration.default_parallel, output: ConsoleOutput.new)
8
9
  @hosts = hosts
@@ -5,6 +5,7 @@ require 'ostruct'
5
5
  require 'tempfile'
6
6
 
7
7
  module Kdeploy
8
+ # ERB template rendering and upload handler
8
9
  class Template
9
10
  def self.render(template_path, variables = {})
10
11
  template_content = File.read(template_path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.1'
5
5
  end
data/lib/kdeploy.rb CHANGED
@@ -15,6 +15,7 @@ require_relative 'kdeploy/template'
15
15
  require_relative 'kdeploy/post_install'
16
16
  require_relative 'kdeploy/cli'
17
17
 
18
+ # Kdeploy - A lightweight agentless deployment automation tool
18
19
  module Kdeploy
19
20
  # Your code goes here...
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kk
@@ -122,48 +122,6 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.12'
125
- - !ruby/object:Gem::Dependency
126
- name: rake
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '13.0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '13.0'
139
- - !ruby/object:Gem::Dependency
140
- name: rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '3.0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '3.0'
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '1.21'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '1.21'
167
125
  description: Kdeploy is a Ruby-based deployment automation tool that provides agentless
168
126
  remote deployment solutions with an elegant DSL
169
127
  email: