kdeploy 1.2.5 → 1.2.7

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.
data/README.md CHANGED
@@ -8,147 +8,149 @@
8
8
  \/ \/\__,_|\___| .__/|_|\___/ \__, |
9
9
  |_| |___/
10
10
 
11
- Lightweight Agentless Deployment Tool
12
- 🚀 Deploy with confidence, scale with ease
11
+ 轻量级无代理部署工具
12
+ 🚀 自信部署,轻松扩展
13
13
  ```
14
14
 
15
- A lightweight, agentless deployment automation tool written in Ruby. Kdeploy enables you to deploy applications, manage configurations, and execute tasks across multiple servers using SSH, without requiring any agents or daemons on target machines.
15
+ 一个用 Ruby 编写的轻量级、无代理的部署自动化工具。Kdeploy 使您能够使用 SSH 在多个服务器上部署应用程序、管理配置和执行任务,而无需在目标机器上安装任何代理或守护进程。
16
16
 
17
17
  [![Gem Version](https://img.shields.io/gem/v/kdeploy)](https://rubygems.org/gems/kdeploy)
18
18
  [![Ruby](https://github.com/kevin197011/kdeploy/actions/workflows/gem-push.yml/badge.svg)](https://github.com/kevin197011/kdeploy/actions/workflows/gem-push.yml)
19
19
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
20
20
 
21
- ## Table of Contents
22
-
23
- - [Features](#-features)
24
- - [Installation](#-installation)
25
- - [Quick Start](#-quick-start)
26
- - [Usage Guide](#-usage-guide)
27
- - [Configuration](#-configuration)
28
- - [Advanced Usage](#-advanced-usage)
29
- - [Error Handling](#-error-handling)
30
- - [Best Practices](#-best-practices)
31
- - [Troubleshooting](#-troubleshooting)
32
- - [Architecture](#-architecture)
33
- - [Development](#-development)
34
- - [Contributing](#-contributing)
35
- - [License](#-license)
36
-
37
- ## 🌟 Features
38
-
39
- ### Core Features
40
-
41
- - 🔑 **Agentless Remote Deployment**: Uses SSH for secure remote execution, no agents required
42
- - 📝 **Elegant Ruby DSL**: Simple and expressive task definition syntax
43
- - 🚀 **Concurrent Execution**: Efficient parallel task processing across multiple hosts
44
- - 📤 **File Upload Support**: Easy file and template deployment via SCP
45
- - 📊 **Task Status Tracking**: Real-time execution monitoring with detailed output
46
- - 🔄 **ERB Template Support**: Dynamic configuration generation with variable substitution
47
- - 🎯 **Role-based Deployment**: Target specific server roles for organized deployments
48
- - 🔍 **Dry Run Mode**: Preview tasks before execution without making changes
49
- - 🎨 **Color-coded Output**: Intuitive color scheme (Green: success, Red: errors, Yellow: warnings)
50
- - ⚙️ **Flexible Host Targeting**: Execute tasks on specific hosts, roles, or all hosts
51
- - 🔐 **Multiple Authentication Methods**: Support for SSH keys and password authentication
52
- - 📈 **Execution Time Tracking**: Monitor task execution duration for performance analysis
53
-
54
- ### Technical Features
55
-
56
- - **Thread-safe Execution**: Built on `concurrent-ruby` for reliable parallel processing
57
- - **Custom Error Handling**: Detailed error types for better debugging
58
- - **Configuration Management**: Centralized configuration with sensible defaults
59
- - **Extensible Architecture**: Modular design for easy extension
60
- - **Shell Completion**: Auto-completion support for Bash and Zsh
61
-
62
- ## 📦 Installation
63
-
64
- ### Requirements
21
+ **语言**: [English](README_EN.md) | [中文](README.md)
22
+
23
+ ## 目录
24
+
25
+ - [功能特性](#-功能特性)
26
+ - [安装](#-安装)
27
+ - [快速开始](#-快速开始)
28
+ - [使用指南](#-使用指南)
29
+ - [配置](#-配置)
30
+ - [高级用法](#-高级用法)
31
+ - [错误处理](#-错误处理)
32
+ - [最佳实践](#-最佳实践)
33
+ - [故障排除](#-故障排除)
34
+ - [架构](#-架构)
35
+ - [开发](#-开发)
36
+ - [贡献](#-贡献)
37
+ - [许可证](#-许可证)
38
+
39
+ ## 🌟 功能特性
40
+
41
+ ### 核心功能
42
+
43
+ - 🔑 **无代理远程部署**: 使用 SSH 进行安全的远程执行,无需安装代理
44
+ - 📝 **优雅的 Ruby DSL**: 简单而富有表现力的任务定义语法
45
+ - 🚀 **并发执行**: 跨多个主机的高效并行任务处理
46
+ - 📤 **文件上传支持**: 通过 SCP 轻松部署文件和模板
47
+ - 📊 **任务状态跟踪**: 实时执行监控,提供详细输出
48
+ - 🔄 **ERB 模板支持**: 支持变量替换的动态配置生成
49
+ - 🎯 **基于角色的部署**: 针对特定服务器角色进行有组织的部署
50
+ - 🔍 **试运行模式**: 在执行前预览任务,不进行实际更改
51
+ - 🎨 **彩色输出**: 直观的颜色方案(绿色:成功,红色:错误,黄色:警告)
52
+ - ⚙️ **灵活的主机定位**: 在特定主机、角色或所有主机上执行任务
53
+ - 🔐 **多种身份验证方法**: 支持 SSH 密钥和密码身份验证
54
+ - 📈 **执行时间跟踪**: 监控任务执行持续时间以进行性能分析
55
+
56
+ ### 技术特性
57
+
58
+ - **线程安全执行**: 基于 `concurrent-ruby` 实现可靠的并行处理
59
+ - **自定义错误处理**: 详细的错误类型,便于调试
60
+ - **配置管理**: 集中式配置,提供合理的默认值
61
+ - **可扩展架构**: 模块化设计,易于扩展
62
+ - **Shell 自动补全**: 支持 Bash 和 Zsh 的自动补全
63
+
64
+ ## 📦 安装
65
+
66
+ ### 要求
65
67
 
66
68
  - Ruby >= 2.7.0
67
- - SSH access to target servers
68
- - SSH keys or password authentication configured
69
+ - 对目标服务器的 SSH 访问权限
70
+ - 已配置 SSH 密钥或密码身份验证
69
71
 
70
- ### Install via RubyGems
72
+ ### 通过 RubyGems 安装
71
73
 
72
74
  ```bash
73
75
  gem install kdeploy
74
76
  ```
75
77
 
76
- ### Install via Bundler
78
+ ### 通过 Bundler 安装
77
79
 
78
- Add this line to your application's `Gemfile`:
80
+ 将以下行添加到应用程序的 `Gemfile` 中:
79
81
 
80
82
  ```ruby
81
83
  gem 'kdeploy'
82
84
  ```
83
85
 
84
- And then execute:
86
+ 然后执行:
85
87
 
86
88
  ```bash
87
89
  bundle install
88
90
  ```
89
91
 
90
- ### Verify Installation
92
+ ### 验证安装
91
93
 
92
94
  ```bash
93
95
  kdeploy version
94
96
  ```
95
97
 
96
- You should see the version information and banner.
98
+ 您应该看到版本信息和横幅。
97
99
 
98
- ### Shell Completion
100
+ ### Shell 自动补全
99
101
 
100
- Kdeploy automatically configures shell completion during installation. If needed, manually add to your shell config:
102
+ Kdeploy 在安装期间自动配置 shell 自动补全。如果需要,可以手动添加到 shell 配置中:
101
103
 
102
- **For Bash** (`~/.bashrc`):
104
+ **对于 Bash** (`~/.bashrc`):
103
105
  ```bash
104
106
  source "$(gem contents kdeploy | grep kdeploy.bash)"
105
107
  ```
106
108
 
107
- **For Zsh** (`~/.zshrc`):
109
+ **对于 Zsh** (`~/.zshrc`):
108
110
  ```bash
109
111
  source "$(gem contents kdeploy | grep kdeploy.zsh)"
110
112
  autoload -Uz compinit && compinit
111
113
  ```
112
114
 
113
- After adding the configuration:
114
- 1. For Bash: `source ~/.bashrc`
115
- 2. For Zsh: `source ~/.zshrc`
115
+ 添加配置后:
116
+ 1. 对于 Bash: `source ~/.bashrc`
117
+ 2. 对于 Zsh: `source ~/.zshrc`
116
118
 
117
- Now you can use Tab completion for:
118
- - Commands: `kdeploy [TAB]`
119
- - File paths: `kdeploy execute [TAB]`
120
- - Options: `kdeploy execute deploy.rb [TAB]`
119
+ 现在您可以使用 Tab 补全:
120
+ - 命令: `kdeploy [TAB]`
121
+ - 文件路径: `kdeploy execute [TAB]`
122
+ - 选项: `kdeploy execute deploy.rb [TAB]`
121
123
 
122
- ## 🚀 Quick Start
124
+ ## 🚀 快速开始
123
125
 
124
- ### 1. Initialize a New Project
126
+ ### 1. 初始化新项目
125
127
 
126
128
  ```bash
127
129
  kdeploy init my-deployment
128
130
  ```
129
131
 
130
- This creates a new directory with:
131
- - `deploy.rb` - Main deployment configuration file
132
- - `config/` - Directory for configuration files and templates
133
- - `README.md` - Project documentation
132
+ 这将创建一个新目录,包含:
133
+ - `deploy.rb` - 主部署配置文件
134
+ - `config/` - 配置文件和模板目录
135
+ - `README.md` - 项目文档
134
136
 
135
- ### 2. Configure Hosts and Tasks
137
+ ### 2. 配置主机和任务
136
138
 
137
- Edit `deploy.rb`:
139
+ 编辑 `deploy.rb`:
138
140
 
139
141
  ```ruby
140
- # Define hosts
142
+ # 定义主机
141
143
  host "web01", user: "ubuntu", ip: "10.0.0.1", key: "~/.ssh/id_rsa"
142
144
  host "web02", user: "ubuntu", ip: "10.0.0.2", key: "~/.ssh/id_rsa"
143
145
 
144
- # Define roles
146
+ # 定义角色
145
147
  role :web, %w[web01 web02]
146
148
 
147
- # Define deployment task
149
+ # 定义部署任务
148
150
  task :deploy, roles: :web do
149
151
  run <<~SHELL
150
152
  sudo systemctl stop nginx
151
- echo "Deploying application..."
153
+ echo "正在部署应用程序..."
152
154
  SHELL
153
155
 
154
156
  upload_template "./config/nginx.conf.erb", "/etc/nginx/nginx.conf",
@@ -159,64 +161,64 @@ task :deploy, roles: :web do
159
161
  end
160
162
  ```
161
163
 
162
- ### 3. Run Deployment
164
+ ### 3. 运行部署
163
165
 
164
166
  ```bash
165
167
  kdeploy execute deploy.rb deploy
166
168
  ```
167
169
 
168
- ## 📖 Usage Guide
170
+ ## 📖 使用指南
169
171
 
170
- ### Command Reference
172
+ ### 命令参考
171
173
 
172
174
  #### `kdeploy init [DIR]`
173
175
 
174
- Initialize a new deployment project.
176
+ 初始化新的部署项目。
175
177
 
176
178
  ```bash
177
- # Initialize in current directory
179
+ # 在当前目录初始化
178
180
  kdeploy init .
179
181
 
180
- # Initialize in named directory
182
+ # 在指定目录初始化
181
183
  kdeploy init my-deployment
182
184
  ```
183
185
 
184
186
  #### `kdeploy execute TASK_FILE [TASK]`
185
187
 
186
- Execute deployment tasks from a configuration file.
188
+ 从配置文件执行部署任务。
187
189
 
188
- **Basic Usage:**
190
+ **基本用法:**
189
191
  ```bash
190
- # Execute all tasks in the file
192
+ # 执行文件中的所有任务
191
193
  kdeploy execute deploy.rb
192
194
 
193
- # Execute a specific task
195
+ # 执行特定任务
194
196
  kdeploy execute deploy.rb deploy_web
195
197
  ```
196
198
 
197
- **Options:**
198
- - `--limit HOSTS`: Limit execution to specific hosts (comma-separated)
199
- - `--parallel NUM`: Number of parallel executions (default: 10)
200
- - `--dry-run`: Preview mode - show what would be done without executing
199
+ **选项:**
200
+ - `--limit HOSTS`: 限制执行到特定主机(逗号分隔)
201
+ - `--parallel NUM`: 并行执行数量(默认: 10
202
+ - `--dry-run`: 预览模式 - 显示将要执行的操作而不实际执行
201
203
 
202
- **Examples:**
204
+ **示例:**
203
205
  ```bash
204
- # Preview deployment without executing
206
+ # 预览部署而不执行
205
207
  kdeploy execute deploy.rb deploy_web --dry-run
206
208
 
207
- # Execute on specific hosts only
209
+ # 仅在特定主机上执行
208
210
  kdeploy execute deploy.rb deploy_web --limit web01,web02
209
211
 
210
- # Use custom parallel count
212
+ # 使用自定义并行数量
211
213
  kdeploy execute deploy.rb deploy_web --parallel 5
212
214
 
213
- # Combine options
215
+ # 组合选项
214
216
  kdeploy execute deploy.rb deploy_web --limit web01 --parallel 3 --dry-run
215
217
  ```
216
218
 
217
219
  #### `kdeploy version`
218
220
 
219
- Show version information.
221
+ 显示版本信息。
220
222
 
221
223
  ```bash
222
224
  kdeploy version
@@ -224,34 +226,34 @@ kdeploy version
224
226
 
225
227
  #### `kdeploy help [COMMAND]`
226
228
 
227
- Show help information.
229
+ 显示帮助信息。
228
230
 
229
231
  ```bash
230
- # Show general help
232
+ # 显示一般帮助
231
233
  kdeploy help
232
234
 
233
- # Show help for specific command
235
+ # 显示特定命令的帮助
234
236
  kdeploy help execute
235
237
  ```
236
238
 
237
- ### Host Definition
239
+ ### 主机定义
238
240
 
239
- #### Basic Host Configuration
241
+ #### 基本主机配置
240
242
 
241
243
  ```ruby
242
- # Single host with SSH key
244
+ # 使用 SSH 密钥的单个主机
243
245
  host "web01",
244
246
  user: "ubuntu",
245
247
  ip: "10.0.0.1",
246
248
  key: "~/.ssh/id_rsa"
247
249
 
248
- # Host with password authentication
250
+ # 使用密码身份验证的主机
249
251
  host "web02",
250
252
  user: "admin",
251
253
  ip: "10.0.0.2",
252
254
  password: "your-password"
253
255
 
254
- # Host with custom SSH port
256
+ # 使用自定义 SSH 端口的主机
255
257
  host "web03",
256
258
  user: "ubuntu",
257
259
  ip: "10.0.0.3",
@@ -259,22 +261,22 @@ host "web03",
259
261
  port: 2222
260
262
  ```
261
263
 
262
- #### Host Configuration Options
264
+ #### 主机配置选项
263
265
 
264
- | Option | Type | Required | Description |
265
- |--------|------|----------|-------------|
266
- | `user` | String | Yes | SSH username |
267
- | `ip` | String | Yes | Server IP address or hostname |
268
- | `key` | String | No* | Path to SSH private key file |
269
- | `password` | String | No* | SSH password |
270
- | `port` | Integer | No | SSH port (default: 22) |
266
+ | 选项 | 类型 | 必需 | 描述 |
267
+ |------|------|------|------|
268
+ | `user` | String | | SSH 用户名 |
269
+ | `ip` | String | | 服务器 IP 地址或主机名 |
270
+ | `key` | String | 否* | SSH 私钥文件路径 |
271
+ | `password` | String | 否* | SSH 密码 |
272
+ | `port` | Integer | | SSH 端口(默认: 22 |
271
273
 
272
- \* Either `key` or `password` is required for authentication.
274
+ \* 身份验证需要 `key` `password` 之一。
273
275
 
274
- #### Dynamic Host Definition
276
+ #### 动态主机定义
275
277
 
276
278
  ```ruby
277
- # Define multiple hosts programmatically
279
+ # 以编程方式定义多个主机
278
280
  %w[web01 web02 web03].each do |name|
279
281
  host name,
280
282
  user: "ubuntu",
@@ -282,7 +284,7 @@ host "web03",
282
284
  key: "~/.ssh/id_rsa"
283
285
  end
284
286
 
285
- # Define hosts from external source
287
+ # 从外部源定义主机
286
288
  require 'yaml'
287
289
  hosts_config = YAML.load_file('hosts.yml')
288
290
  hosts_config.each do |name, config|
@@ -290,35 +292,35 @@ hosts_config.each do |name, config|
290
292
  end
291
293
  ```
292
294
 
293
- ### Role Management
295
+ ### 角色管理
294
296
 
295
- Roles allow you to group hosts and target them collectively in tasks.
297
+ 角色允许您对主机进行分组,并在任务中集体定位它们。
296
298
 
297
299
  ```ruby
298
- # Define roles
300
+ # 定义角色
299
301
  role :web, %w[web01 web02 web03]
300
302
  role :db, %w[db01 db02]
301
303
  role :cache, %w[cache01]
302
304
  role :all, %w[web01 web02 web03 db01 db02 cache01]
303
305
 
304
- # Use roles in tasks
306
+ # 在任务中使用角色
305
307
  task :deploy_web, roles: :web do
306
- # Executes on all web servers
308
+ # 在所有 Web 服务器上执行
307
309
  end
308
310
 
309
311
  task :backup_db, roles: :db do
310
- # Executes on all database servers
312
+ # 在所有数据库服务器上执行
311
313
  end
312
314
 
313
- # Multiple roles
315
+ # 多个角色
314
316
  task :deploy_all, roles: [:web, :cache] do
315
- # Executes on web and cache servers
317
+ # Web 和缓存服务器上执行
316
318
  end
317
319
  ```
318
320
 
319
- ### Task Definition
321
+ ### 任务定义
320
322
 
321
- #### Basic Task
323
+ #### 基本任务
322
324
 
323
325
  ```ruby
324
326
  task :hello do
@@ -326,7 +328,7 @@ task :hello do
326
328
  end
327
329
  ```
328
330
 
329
- #### Role-based Task
331
+ #### 基于角色的任务
330
332
 
331
333
  ```ruby
332
334
  task :deploy_web, roles: :web do
@@ -334,7 +336,7 @@ task :deploy_web, roles: :web do
334
336
  end
335
337
  ```
336
338
 
337
- #### Host-specific Task
339
+ #### 特定主机任务
338
340
 
339
341
  ```ruby
340
342
  task :maintenance, on: %w[web01] do
@@ -346,44 +348,44 @@ task :maintenance, on: %w[web01] do
346
348
  end
347
349
  ```
348
350
 
349
- #### Task with Multiple Commands
351
+ #### 多命令任务
350
352
 
351
353
  ```ruby
352
354
  task :deploy, roles: :web do
353
- # Stop service
355
+ # 停止服务
354
356
  run "sudo systemctl stop nginx"
355
357
 
356
- # Upload configuration
358
+ # 上传配置
357
359
  upload "./config/nginx.conf", "/etc/nginx/nginx.conf"
358
360
 
359
- # Start service
361
+ # 启动服务
360
362
  run "sudo systemctl start nginx"
361
363
 
362
- # Verify status
364
+ # 验证状态
363
365
  run "sudo systemctl status nginx"
364
366
  end
365
367
  ```
366
368
 
367
- #### Task Options
369
+ #### 任务选项
368
370
 
369
- | Option | Type | Description |
370
- |-------|------|-------------|
371
- | `roles` | Symbol/Array | Execute on hosts with specified role(s) |
372
- | `on` | Array | Execute on specific host(s) |
371
+ | 选项 | 类型 | 描述 |
372
+ |------|------|------|
373
+ | `roles` | Symbol/Array | 在具有指定角色的主机上执行 |
374
+ | `on` | Array | 在特定主机上执行 |
373
375
 
374
- **Note**: If neither `roles` nor `on` is specified, the task executes on all defined hosts.
376
+ **注意**: 如果未指定 `roles` `on`,任务将在所有已定义的主机上执行。
375
377
 
376
- ### Command Types
378
+ ### 命令类型
377
379
 
378
- #### `run` - Execute Shell Commands
380
+ #### `run` - 执行 Shell 命令
379
381
 
380
- Execute commands on remote servers.
382
+ 在远程服务器上执行命令。
381
383
 
382
384
  ```ruby
383
- # Single line command
385
+ # 单行命令
384
386
  run "sudo systemctl restart nginx"
385
387
 
386
- # Multi-line command (recommended for complex commands)
388
+ # 多行命令(推荐用于复杂命令)
387
389
  run <<~SHELL
388
390
  cd /var/www/app
389
391
  git pull origin main
@@ -392,24 +394,24 @@ run <<~SHELL
392
394
  SHELL
393
395
  ```
394
396
 
395
- **Best Practice**: Use heredoc (`<<~SHELL`) for multi-line commands to improve readability.
397
+ **最佳实践**: 对多行命令使用 heredoc (`<<~SHELL`) 以提高可读性。
396
398
 
397
- #### `upload` - Upload Files
399
+ #### `upload` - 上传文件
398
400
 
399
- Upload files to remote servers.
401
+ 将文件上传到远程服务器。
400
402
 
401
403
  ```ruby
402
404
  upload "./config/nginx.conf", "/etc/nginx/nginx.conf"
403
405
  upload "./scripts/deploy.sh", "/tmp/deploy.sh"
404
406
  ```
405
407
 
406
- **Parameters:**
407
- - `source`: Local file path
408
- - `destination`: Remote file path
408
+ **参数:**
409
+ - `source`: 本地文件路径
410
+ - `destination`: 远程文件路径
409
411
 
410
- #### `upload_template` - Upload ERB Templates
412
+ #### `upload_template` - 上传 ERB 模板
411
413
 
412
- Upload and render ERB templates with variable substitution.
414
+ 上传并渲染 ERB 模板,支持变量替换。
413
415
 
414
416
  ```ruby
415
417
  upload_template "./config/nginx.conf.erb", "/etc/nginx/nginx.conf",
@@ -418,18 +420,18 @@ upload_template "./config/nginx.conf.erb", "/etc/nginx/nginx.conf",
418
420
  worker_processes: 4
419
421
  ```
420
422
 
421
- **Parameters:**
422
- - `source`: Local ERB template file path
423
- - `destination`: Remote file path
424
- - `variables`: Hash of variables for template rendering
423
+ **参数:**
424
+ - `source`: 本地 ERB 模板文件路径
425
+ - `destination`: 远程文件路径
426
+ - `variables`: 用于模板渲染的变量哈希
425
427
 
426
- ### Template Support
428
+ ### 模板支持
427
429
 
428
- Kdeploy supports ERB (Embedded Ruby) templates for dynamic configuration generation.
430
+ Kdeploy 支持 ERB(嵌入式 Ruby)模板,用于动态配置生成。
429
431
 
430
- #### Creating Templates
432
+ #### 创建模板
431
433
 
432
- Create an ERB template file (e.g., `config/nginx.conf.erb`):
434
+ 创建 ERB 模板文件(例如,`config/nginx.conf.erb`):
433
435
 
434
436
  ```erb
435
437
  user nginx;
@@ -465,7 +467,7 @@ http {
465
467
  }
466
468
  ```
467
469
 
468
- #### Using Templates
470
+ #### 使用模板
469
471
 
470
472
  ```ruby
471
473
  task :deploy_config do
@@ -477,17 +479,17 @@ task :deploy_config do
477
479
  end
478
480
  ```
479
481
 
480
- #### Template Features
482
+ #### 模板特性
481
483
 
482
- - Full ERB syntax support
483
- - Variable substitution
484
- - Conditional logic
485
- - Loops and iterations
486
- - Ruby code execution
484
+ - 完整的 ERB 语法支持
485
+ - 变量替换
486
+ - 条件逻辑
487
+ - 循环和迭代
488
+ - Ruby 代码执行
487
489
 
488
- ### Inventory Block
490
+ ### 清单块
489
491
 
490
- Use the `inventory` block to organize host definitions:
492
+ 使用 `inventory` 块来组织主机定义:
491
493
 
492
494
  ```ruby
493
495
  inventory do
@@ -497,28 +499,28 @@ inventory do
497
499
  end
498
500
  ```
499
501
 
500
- ## ⚙️ Configuration
502
+ ## ⚙️ 配置
501
503
 
502
- ### Default Configuration
504
+ ### 默认配置
503
505
 
504
- Kdeploy uses sensible defaults that can be customized:
506
+ Kdeploy 使用可自定义的合理默认值:
505
507
 
506
- - **Default Parallel Count**: 10 concurrent executions
507
- - **SSH Timeout**: 30 seconds
508
- - **Host Key Verification**: Disabled (for convenience, enable in production)
508
+ - **默认并行数量**: 10 个并发执行
509
+ - **SSH 超时**: 30
510
+ - **主机密钥验证**: 禁用(为方便起见,在生产环境中启用)
509
511
 
510
- ### Environment Variables
512
+ ### 环境变量
511
513
 
512
- You can override defaults using environment variables:
514
+ 您可以使用环境变量覆盖默认值:
513
515
 
514
516
  ```bash
515
517
  export KDEPLOY_PARALLEL=5
516
518
  export KDEPLOY_SSH_TIMEOUT=60
517
519
  ```
518
520
 
519
- ### Configuration File
521
+ ### 配置文件
520
522
 
521
- For project-specific configuration, create a `.kdeploy.yml`:
523
+ 对于项目特定的配置,创建 `.kdeploy.yml`:
522
524
 
523
525
  ```yaml
524
526
  parallel: 5
@@ -526,11 +528,13 @@ ssh_timeout: 60
526
528
  verify_host_key: true
527
529
  ```
528
530
 
529
- ## 🔧 Advanced Usage
531
+ 配置文件会自动从当前目录向上查找,直到找到 `.kdeploy.yml` 文件。
530
532
 
531
- ### Conditional Execution
533
+ ## 🔧 高级用法
532
534
 
533
- Use Ruby conditionals in your deployment files:
535
+ ### 条件执行
536
+
537
+ 在部署文件中使用 Ruby 条件:
534
538
 
535
539
  ```ruby
536
540
  task :deploy do
@@ -546,38 +550,38 @@ task :deploy do
546
550
  end
547
551
  ```
548
552
 
549
- ### Looping Over Hosts
553
+ ### 循环主机
550
554
 
551
555
  ```ruby
552
- # Execute different commands based on host
556
+ # 根据主机执行不同的命令
553
557
  task :custom_setup do
554
558
  @hosts.each do |name, config|
555
559
  if name.start_with?('web')
556
- run "echo 'Web server: #{name}'"
560
+ run "echo 'Web 服务器: #{name}'"
557
561
  elsif name.start_with?('db')
558
- run "echo 'Database server: #{name}'"
562
+ run "echo '数据库服务器: #{name}'"
559
563
  end
560
564
  end
561
565
  end
562
566
  ```
563
567
 
564
- ### Error Handling in Tasks
568
+ ### 任务中的错误处理
565
569
 
566
570
  ```ruby
567
571
  task :deploy do
568
- run "sudo systemctl stop nginx" || raise "Failed to stop nginx"
572
+ run "sudo systemctl stop nginx" || raise "停止 nginx 失败"
569
573
  upload "./config/nginx.conf", "/etc/nginx/nginx.conf"
570
- run "sudo systemctl start nginx" || raise "Failed to start nginx"
574
+ run "sudo systemctl start nginx" || raise "启动 nginx 失败"
571
575
  end
572
576
  ```
573
577
 
574
- ### Using External Libraries
578
+ ### 使用外部库
575
579
 
576
580
  ```ruby
577
581
  require 'yaml'
578
582
  require 'json'
579
583
 
580
- # Load configuration from external files
584
+ # 从外部文件加载配置
581
585
  config = YAML.load_file('config.yml')
582
586
 
583
587
  task :deploy do
@@ -587,86 +591,48 @@ task :deploy do
587
591
  end
588
592
  ```
589
593
 
590
- ### Task Dependencies
591
-
592
- While Kdeploy doesn't have built-in task dependencies, you can achieve this with Ruby:
593
-
594
- ```ruby
595
- task :setup do
596
- run "echo 'Setting up...'"
597
- end
598
-
599
- task :deploy do
600
- # Manually call setup task
601
- self.class.kdeploy_tasks[:setup][:block].call.each do |cmd|
602
- case cmd[:type]
603
- when :run
604
- run cmd[:command]
605
- when :upload
606
- upload cmd[:source], cmd[:destination]
607
- end
608
- end
609
-
610
- run "echo 'Deploying...'"
611
- end
612
- ```
613
-
614
- ## 🚨 Error Handling
615
-
616
- ### Error Types
617
-
618
- Kdeploy provides specific error types for better debugging:
594
+ ## 🚨 错误处理
619
595
 
620
- - `Kdeploy::TaskNotFoundError` - Task not found
621
- - `Kdeploy::HostNotFoundError` - Host not found
622
- - `Kdeploy::SSHError` - SSH operation failed
623
- - `Kdeploy::SCPError` - SCP upload failed
624
- - `Kdeploy::TemplateError` - Template rendering failed
625
- - `Kdeploy::ConfigurationError` - Configuration error
626
- - `Kdeploy::FileNotFoundError` - File not found
596
+ ### 错误类型
627
597
 
628
- ### Error Output
598
+ Kdeploy 提供特定的错误类型以便更好地调试:
629
599
 
630
- Errors are displayed with:
631
- - Red color coding
632
- - Detailed error messages
633
- - Host information
634
- - Original error context
600
+ - `Kdeploy::TaskNotFoundError` - 任务未找到
601
+ - `Kdeploy::HostNotFoundError` - 主机未找到
602
+ - `Kdeploy::SSHError` - SSH 操作失败
603
+ - `Kdeploy::SCPError` - SCP 上传失败
604
+ - `Kdeploy::TemplateError` - 模板渲染失败
605
+ - `Kdeploy::ConfigurationError` - 配置错误
606
+ - `Kdeploy::FileNotFoundError` - 文件未找到
635
607
 
636
- ### Handling Errors
608
+ ### 错误输出
637
609
 
638
- ```ruby
639
- # In your deployment file
640
- begin
641
- task :deploy do
642
- run "risky-command"
643
- end
644
- rescue Kdeploy::SSHError => e
645
- puts "SSH Error: #{e.message}"
646
- # Handle error
647
- end
648
- ```
610
+ 错误显示包括:
611
+ - 红色颜色编码
612
+ - 详细的错误消息
613
+ - 主机信息
614
+ - 原始错误上下文
649
615
 
650
- ## 💡 Best Practices
616
+ ## 💡 最佳实践
651
617
 
652
- ### 1. Use Heredoc for Multi-line Commands
618
+ ### 1. 对多行命令使用 Heredoc
653
619
 
654
620
  ```ruby
655
- # ✅ Good
621
+ # ✅ 好的做法
656
622
  run <<~SHELL
657
623
  cd /var/www/app
658
624
  git pull origin main
659
625
  bundle install
660
626
  SHELL
661
627
 
662
- # ❌ Avoid
628
+ # ❌ 避免
663
629
  run "cd /var/www/app && git pull origin main && bundle install"
664
630
  ```
665
631
 
666
- ### 2. Organize with Roles
632
+ ### 2. 使用角色进行组织
667
633
 
668
634
  ```ruby
669
- # ✅ Good - Use roles for organization
635
+ # ✅ 好的做法 - 使用角色进行组织
670
636
  role :web, %w[web01 web02]
671
637
  role :db, %w[db01 db02]
672
638
 
@@ -674,274 +640,259 @@ task :deploy_web, roles: :web do
674
640
  # ...
675
641
  end
676
642
 
677
- # ❌ Avoid - Hardcoding host names
643
+ # ❌ 避免 - 硬编码主机名
678
644
  task :deploy do
679
- # Hard to maintain
645
+ # 难以维护
680
646
  end
681
647
  ```
682
648
 
683
- ### 3. Use Templates for Dynamic Configuration
649
+ ### 3. 使用模板进行动态配置
684
650
 
685
651
  ```ruby
686
- # ✅ Good - Use templates
652
+ # ✅ 好的做法 - 使用模板
687
653
  upload_template "./config/nginx.conf.erb", "/etc/nginx/nginx.conf",
688
654
  domain_name: "example.com",
689
655
  port: 3000
690
656
 
691
- # ❌ Avoid - Hardcoding values
657
+ # ❌ 避免 - 硬编码值
692
658
  run "echo 'server_name example.com;' > /etc/nginx/nginx.conf"
693
659
  ```
694
660
 
695
- ### 4. Validate Before Deployment
661
+ ### 4. 部署前验证
696
662
 
697
663
  ```ruby
698
664
  task :deploy do
699
- # Validate configuration
700
- run "nginx -t" || raise "Nginx configuration is invalid"
665
+ # 验证配置
666
+ run "nginx -t" || raise "Nginx 配置无效"
701
667
 
702
- # Deploy
668
+ # 部署
703
669
  upload "./config/nginx.conf", "/etc/nginx/nginx.conf"
704
670
  run "sudo systemctl reload nginx"
705
671
  end
706
672
  ```
707
673
 
708
- ### 5. Use Dry Run for Testing
674
+ ### 5. 使用试运行进行测试
709
675
 
710
- Always test with `--dry-run` before actual deployment:
676
+ 在实际部署之前,始终使用 `--dry-run` 进行测试:
711
677
 
712
678
  ```bash
713
679
  kdeploy execute deploy.rb deploy_web --dry-run
714
680
  ```
715
681
 
716
- ### 6. Organize Files Properly
682
+ ### 6. 正确组织文件
717
683
 
718
684
  ```
719
685
  project/
720
- ├── deploy.rb # Main deployment file
721
- ├── config/ # Configuration files
722
- │ ├── nginx.conf.erb # Templates
723
- │ └── app.conf # Static configs
724
- └── scripts/ # Helper scripts
686
+ ├── deploy.rb # 主部署文件
687
+ ├── config/ # 配置文件
688
+ │ ├── nginx.conf.erb # 模板
689
+ │ └── app.conf # 静态配置
690
+ └── scripts/ # 辅助脚本
725
691
  └── deploy.sh
726
692
  ```
727
693
 
728
- ### 7. Version Control
694
+ ### 7. 版本控制
729
695
 
730
- - Commit `deploy.rb` and templates
731
- - Use `.gitignore` for sensitive files
732
- - Store secrets in environment variables
696
+ - 提交 `deploy.rb` 和模板
697
+ - 使用 `.gitignore` 处理敏感文件
698
+ - 将密钥存储在环境变量中
733
699
 
734
- ### 8. Parallel Execution
700
+ ### 8. 并行执行
735
701
 
736
- Adjust parallel count based on your infrastructure:
702
+ 根据您的基础设施调整并行数量:
737
703
 
738
704
  ```bash
739
- # For many hosts, increase parallel count
705
+ # 对于许多主机,增加并行数量
740
706
  kdeploy execute deploy.rb deploy --parallel 20
741
707
 
742
- # For limited resources, decrease
708
+ # 对于有限资源,减少
743
709
  kdeploy execute deploy.rb deploy --parallel 3
744
710
  ```
745
711
 
746
- ## 🔍 Troubleshooting
747
-
748
- ### Common Issues
749
-
750
- #### SSH Authentication Failed
712
+ ## 🔍 故障排除
751
713
 
752
- **Problem**: `SSH authentication failed`
714
+ ### 常见问题
753
715
 
754
- **Solutions**:
755
- 1. Verify SSH key path is correct
756
- 2. Check key permissions: `chmod 600 ~/.ssh/id_rsa`
757
- 3. Test SSH connection manually: `ssh user@host`
758
- 4. Verify username and IP address
716
+ #### SSH 身份验证失败
759
717
 
760
- #### Host Not Found
718
+ **问题**: `SSH authentication failed`
761
719
 
762
- **Problem**: `No hosts found for task`
720
+ **解决方案**:
721
+ 1. 验证 SSH 密钥路径是否正确
722
+ 2. 检查密钥权限: `chmod 600 ~/.ssh/id_rsa`
723
+ 3. 手动测试 SSH 连接: `ssh user@host`
724
+ 4. 验证用户名和 IP 地址
763
725
 
764
- **Solutions**:
765
- 1. Verify host names in task match defined hosts
766
- 2. Check role definitions
767
- 3. Verify `--limit` option if used
726
+ #### 主机未找到
768
727
 
769
- #### Command Execution Failed
728
+ **问题**: `No hosts found for task`
770
729
 
771
- **Problem**: Commands fail on remote server
730
+ **解决方案**:
731
+ 1. 验证任务中的主机名是否与已定义的主机匹配
732
+ 2. 检查角色定义
733
+ 3. 如果使用了 `--limit` 选项,请验证
772
734
 
773
- **Solutions**:
774
- 1. Test commands manually on target server
775
- 2. Check user permissions (may need sudo)
776
- 3. Verify command syntax
777
- 4. Check server logs
735
+ #### 命令执行失败
778
736
 
779
- #### Template Rendering Error
737
+ **问题**: 远程服务器上的命令失败
780
738
 
781
- **Problem**: Template upload fails
739
+ **解决方案**:
740
+ 1. 在目标服务器上手动测试命令
741
+ 2. 检查用户权限(可能需要 sudo)
742
+ 3. 验证命令语法
743
+ 4. 检查服务器日志
782
744
 
783
- **Solutions**:
784
- 1. Verify ERB syntax in template
785
- 2. Check all required variables are provided
786
- 3. Validate template file exists
787
- 4. Test template rendering locally
745
+ #### 模板渲染错误
788
746
 
789
- #### Connection Timeout
747
+ **问题**: 模板上传失败
790
748
 
791
- **Problem**: SSH connection times out
749
+ **解决方案**:
750
+ 1. 验证模板中的 ERB 语法
751
+ 2. 检查是否提供了所有必需的变量
752
+ 3. 验证模板文件是否存在
753
+ 4. 在本地测试模板渲染
792
754
 
793
- **Solutions**:
794
- 1. Check network connectivity
795
- 2. Verify firewall rules
796
- 3. Increase timeout in configuration
797
- 4. Check SSH service on target server
755
+ #### 连接超时
798
756
 
799
- ### Debug Mode
757
+ **问题**: SSH 连接超时
800
758
 
801
- Enable verbose output by checking the execution output. Kdeploy provides detailed information about:
802
- - Task execution status
803
- - Command output
804
- - Error messages
805
- - Execution duration
759
+ **解决方案**:
760
+ 1. 检查网络连接
761
+ 2. 验证防火墙规则
762
+ 3. 在配置中增加超时时间
763
+ 4. 检查目标服务器上的 SSH 服务
806
764
 
807
- ### Getting Help
765
+ ## 🏗️ 架构
808
766
 
809
- - Check [GitHub Issues](https://github.com/kevin197011/kdeploy/issues)
810
- - Review example projects
811
- - Read the documentation
812
- - Ask in discussions
767
+ ### 核心组件
813
768
 
814
- ## 🏗️ Architecture
769
+ - **CLI** (`cli.rb`): 使用 Thor 的命令行界面
770
+ - **DSL** (`dsl.rb`): 用于任务定义的领域特定语言
771
+ - **Executor** (`executor.rb`): SSH/SCP 执行引擎
772
+ - **Runner** (`runner.rb`): 并发任务执行协调器
773
+ - **CommandExecutor** (`command_executor.rb`): 单个命令执行
774
+ - **CommandGrouper** (`command_grouper.rb`): 命令分组逻辑
775
+ - **Template** (`template.rb`): ERB 模板渲染
776
+ - **Output** (`output.rb`): 输出格式化和显示
777
+ - **Configuration** (`configuration.rb`): 配置管理
778
+ - **Errors** (`errors.rb`): 自定义错误类型
815
779
 
816
- ### Core Components
780
+ ### 执行流程
817
781
 
818
- - **CLI** (`cli.rb`): Command-line interface using Thor
819
- - **DSL** (`dsl.rb`): Domain-specific language for task definition
820
- - **Executor** (`executor.rb`): SSH/SCP execution engine
821
- - **Runner** (`runner.rb`): Concurrent task execution coordinator
822
- - **CommandExecutor** (`command_executor.rb`): Individual command execution
823
- - **CommandGrouper** (`command_grouper.rb`): Command grouping logic
824
- - **Template** (`template.rb`): ERB template rendering
825
- - **Output** (`output.rb`): Output formatting and display
826
- - **Configuration** (`configuration.rb`): Configuration management
827
- - **Errors** (`errors.rb`): Custom error types
782
+ 1. **解析配置**: 加载并解析 `deploy.rb`
783
+ 2. **解析主机**: 根据任务定义确定目标主机
784
+ 3. **分组命令**: 按类型分组命令以提高执行效率
785
+ 4. **并发执行**: 跨主机并行运行任务
786
+ 5. **收集结果**: 收集执行结果和状态
787
+ 6. **显示输出**: 格式化并向用户显示结果
828
788
 
829
- ### Execution Flow
789
+ ### 并发模型
830
790
 
831
- 1. **Parse Configuration**: Load and parse `deploy.rb`
832
- 2. **Resolve Hosts**: Determine target hosts based on task definition
833
- 3. **Group Commands**: Group commands by type for efficient execution
834
- 4. **Execute Concurrently**: Run tasks in parallel across hosts
835
- 5. **Collect Results**: Gather execution results and status
836
- 6. **Display Output**: Format and display results to user
791
+ Kdeploy 使用带有固定线程池的 `concurrent-ruby`:
792
+ - 默认: 10 个并发执行
793
+ - 可通过 `--parallel` 选项配置
794
+ - 线程安全的结果收集
795
+ - 自动资源清理
837
796
 
838
- ### Concurrency Model
797
+ ## 🔧 开发
839
798
 
840
- Kdeploy uses `concurrent-ruby` with a fixed thread pool:
841
- - Default: 10 concurrent executions
842
- - Configurable via `--parallel` option
843
- - Thread-safe result collection
844
- - Automatic resource cleanup
845
-
846
- ## 🔧 Development
847
-
848
- ### Setup Development Environment
799
+ ### 设置开发环境
849
800
 
850
801
  ```bash
851
- # Clone repository
802
+ # 克隆仓库
852
803
  git clone https://github.com/kevin197011/kdeploy.git
853
804
  cd kdeploy
854
805
 
855
- # Install dependencies
806
+ # 安装依赖
856
807
  bundle install
857
808
 
858
- # Run tests
809
+ # 运行测试
859
810
  bundle exec rspec
860
811
 
861
- # Run console
812
+ # 运行控制台
862
813
  bin/console
863
814
  ```
864
815
 
865
- ### Project Structure
816
+ ### 项目结构
866
817
 
867
818
  ```
868
819
  kdeploy/
869
820
  ├── lib/
870
821
  │ └── kdeploy/
871
- │ ├── cli.rb # CLI interface
872
- │ ├── dsl.rb # DSL definition
873
- │ ├── executor.rb # SSH/SCP executor
874
- │ ├── runner.rb # Task runner
875
- │ ├── command_executor.rb # Command executor
876
- │ ├── command_grouper.rb # Command grouper
877
- │ ├── template.rb # Template handler
878
- │ ├── output.rb # Output interface
879
- │ ├── configuration.rb # Configuration
880
- │ ├── errors.rb # Error types
822
+ │ ├── cli.rb # CLI 接口
823
+ │ ├── dsl.rb # DSL 定义
824
+ │ ├── executor.rb # SSH/SCP 执行器
825
+ │ ├── runner.rb # 任务运行器
826
+ │ ├── command_executor.rb # 命令执行器
827
+ │ ├── command_grouper.rb # 命令分组器
828
+ │ ├── template.rb # 模板处理器
829
+ │ ├── output.rb # 输出接口
830
+ │ ├── configuration.rb # 配置
831
+ │ ├── errors.rb # 错误类型
881
832
  │ └── ...
882
- ├── spec/ # Tests
883
- ├── exe/ # Executables
884
- ├── sample/ # Example projects
885
- └── README.md # This file
833
+ ├── spec/ # 测试
834
+ ├── exe/ # 可执行文件
835
+ ├── sample/ # 示例项目
836
+ └── README.md # 本文档
886
837
  ```
887
838
 
888
- ### Running Tests
839
+ ### 运行测试
889
840
 
890
841
  ```bash
891
- # Run all tests
842
+ # 运行所有测试
892
843
  bundle exec rspec
893
844
 
894
- # Run specific test file
845
+ # 运行特定测试文件
895
846
  bundle exec rspec spec/kdeploy_spec.rb
896
847
 
897
- # Run with coverage
848
+ # 运行覆盖率
898
849
  COVERAGE=true bundle exec rspec
899
850
  ```
900
851
 
901
- ### Building the Gem
852
+ ### 构建 Gem
902
853
 
903
854
  ```bash
904
- # Build gem
855
+ # 构建 gem
905
856
  gem build kdeploy.gemspec
906
857
 
907
- # Install locally
858
+ # 本地安装
908
859
  gem install ./kdeploy-*.gem
909
860
  ```
910
861
 
911
- ### Code Style
862
+ ### 代码风格
912
863
 
913
- The project uses RuboCop for code style:
864
+ 项目使用 RuboCop 进行代码风格检查:
914
865
 
915
866
  ```bash
916
- # Check style
867
+ # 检查风格
917
868
  bundle exec rubocop
918
869
 
919
- # Auto-fix issues
870
+ # 自动修复问题
920
871
  bundle exec rubocop -a
921
872
  ```
922
873
 
923
- ## 🤝 Contributing
874
+ ## 🤝 贡献
924
875
 
925
- Contributions are welcome! Please follow these steps:
876
+ 欢迎贡献!请遵循以下步骤:
926
877
 
927
- 1. **Fork the repository**
928
- 2. **Create a feature branch**: `git checkout -b feature/my-new-feature`
929
- 3. **Make your changes**: Follow the code style and add tests
930
- 4. **Commit your changes**: Use conventional commit messages
931
- 5. **Push to the branch**: `git push origin feature/my-new-feature`
932
- 6. **Create a Pull Request**: Provide a clear description of changes
878
+ 1. **Fork 仓库**
879
+ 2. **创建功能分支**: `git checkout -b feature/my-new-feature`
880
+ 3. **进行更改**: 遵循代码风格并添加测试
881
+ 4. **提交更改**: 使用约定式提交消息
882
+ 5. **推送到分支**: `git push origin feature/my-new-feature`
883
+ 6. **创建 Pull Request**: 提供清晰的更改描述
933
884
 
934
- ### Contribution Guidelines
885
+ ### 贡献指南
935
886
 
936
- - Follow existing code style
937
- - Add tests for new features
938
- - Update documentation
939
- - Ensure all tests pass
940
- - Follow conventional commit format
887
+ - 遵循现有代码风格
888
+ - 为新功能添加测试
889
+ - 更新文档
890
+ - 确保所有测试通过
891
+ - 遵循约定式提交格式
941
892
 
942
- ### Commit Message Format
893
+ ### 提交消息格式
943
894
 
944
- Follow [Conventional Commits](https://www.conventionalcommits.org/):
895
+ 遵循 [约定式提交](https://www.conventionalcommits.org/):
945
896
 
946
897
  ```
947
898
  <type>(<scope>): <subject>
@@ -951,17 +902,17 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/):
951
902
  <footer>
952
903
  ```
953
904
 
954
- Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
905
+ 类型: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
955
906
 
956
- ## 📚 Examples
907
+ ## 📚 示例
957
908
 
958
- ### Example Projects
909
+ ### 示例项目
959
910
 
960
- Check out the [example project](https://github.com/kevin197011/kdeploy-app) for a complete deployment setup.
911
+ 查看 [示例项目](https://github.com/kevin197011/kdeploy-app) 以获取完整的部署设置。
961
912
 
962
- ### Common Deployment Scenarios
913
+ ### 常见部署场景
963
914
 
964
- #### Web Application Deployment
915
+ #### Web 应用程序部署
965
916
 
966
917
  ```ruby
967
918
  host "web01", user: "deploy", ip: "10.0.0.1", key: "~/.ssh/id_rsa"
@@ -978,7 +929,7 @@ task :deploy_app, roles: :web do
978
929
  end
979
930
  ```
980
931
 
981
- #### Database Backup
932
+ #### 数据库备份
982
933
 
983
934
  ```ruby
984
935
  host "db01", user: "postgres", ip: "10.0.0.10", key: "~/.ssh/id_rsa"
@@ -994,7 +945,7 @@ task :backup, roles: :db do
994
945
  end
995
946
  ```
996
947
 
997
- #### Configuration Management
948
+ #### 配置管理
998
949
 
999
950
  ```ruby
1000
951
  task :update_config, roles: :web do
@@ -1007,23 +958,24 @@ task :update_config, roles: :web do
1007
958
  end
1008
959
  ```
1009
960
 
1010
- ## 📝 License
961
+ ## 📝 许可证
1011
962
 
1012
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
963
+ gem [MIT 许可证](https://opensource.org/licenses/MIT) 条款下作为开源提供。
1013
964
 
1014
- ## 🔗 Links
965
+ ## 🔗 链接
1015
966
 
1016
967
  - **GitHub**: https://github.com/kevin197011/kdeploy
1017
968
  - **RubyGems**: https://rubygems.org/gems/kdeploy
1018
969
  - **Issues**: https://github.com/kevin197011/kdeploy/issues
1019
- - **Example Project**: https://github.com/kevin197011/kdeploy-app
970
+ - **示例项目**: https://github.com/kevin197011/kdeploy-app
1020
971
 
1021
- ## 🙏 Acknowledgments
972
+ ## 🙏 致谢
1022
973
 
1023
- - Built with [Thor](https://github.com/rails/thor) for CLI
1024
- - Uses [net-ssh](https://github.com/net-ssh/net-ssh) for SSH operations
1025
- - Powered by [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) for concurrency
974
+ - 使用 [Thor](https://github.com/rails/thor) 构建 CLI
975
+ - 使用 [net-ssh](https://github.com/net-ssh/net-ssh) 进行 SSH 操作
976
+ - [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) 提供并发支持
1026
977
 
1027
978
  ---
1028
979
 
1029
- **Made with ❤️ for the DevOps community**
980
+ **为 DevOps 社区用 ❤️ 制作**
981
+