kdeploy 1.0.1 → 1.0.2

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: 49d961844c07920b802b76ae12a6f45d49be63955e3d5c78ab68cc0e2c2b4f3e
4
- data.tar.gz: 7eb0c1863c4874c481f71af6f7c4b0f523984349200c8eb8592c1b9fe20025cd
3
+ metadata.gz: 8ae2bd2f567f7b160a845830a1f3ffd63a5f46037018ab2ca42aec65f65e5c3c
4
+ data.tar.gz: 3865ed7280339e8a225a12709982a9570d116fc7cd5f0adbc648673123976fb5
5
5
  SHA512:
6
- metadata.gz: 18ad6647967c2388bd76d4d1d3b81b890116e236d8059bf9d653009cebe09989341b1573c957f5eb3a8ab81f24c8ad5ea1dcd6351d7d58886e62d57bf898cde2
7
- data.tar.gz: 795c2c40e0614ac08e535b5ec16613fe1370c2f0513498da454a7a660af425b768bfe8c1694db95a1926bb3633e2cc9549c0ef927b0fd2223ead3010a72ab908
6
+ metadata.gz: d58d7a011c9b57e318a97e74ce394b8862f3f4025708008be4eb5b4d4b2970d1087e0a7255d2970091aee8f2bb813b31353cd8aab0e9605bc6eba8cb8da83e8f
7
+ data.tar.gz: d69468308df5ef175023159cd5ee4860d3b65187374928a6aacd3bbcd38095d701d6a303465e20079a5355f39d8a5ffcc7322cf3628930ab2d012080adf87bc1
data/README.md CHANGED
@@ -15,6 +15,9 @@
15
15
 
16
16
  A lightweight agentless deployment automation tool written in Ruby.
17
17
 
18
+ [![Gem Version](https://badge.fury.io/rb/kdeploy.svg)](https://badge.fury.io/rb/kdeploy)
19
+ [![Ruby](https://github.com/kevin197011/kdeploy/actions/workflows/gem-push.yml/badge.svg)](https://github.com/kevin197011/kdeploy/actions/workflows/gem-push.yml)
20
+
18
21
  ## 🌟 Features
19
22
 
20
23
  - 🔑 **Agentless Remote Deployment**: Uses SSH for secure remote execution
@@ -38,13 +41,13 @@ gem 'kdeploy'
38
41
  And then execute:
39
42
 
40
43
  ```bash
41
- $ bundle install
44
+ bundle install
42
45
  ```
43
46
 
44
47
  Or install it yourself as:
45
48
 
46
49
  ```bash
47
- $ gem install kdeploy
50
+ gem install kdeploy
48
51
  ```
49
52
 
50
53
  ### Shell Completion
@@ -76,7 +79,7 @@ Now you can use Tab completion for:
76
79
  1. Initialize a new project:
77
80
 
78
81
  ```bash
79
- $ kdeploy init my-deployment
82
+ kdeploy init my-deployment
80
83
  ```
81
84
 
82
85
  2. Edit the deployment configuration:
@@ -104,11 +107,7 @@ end
104
107
  3. Run the deployment:
105
108
 
106
109
  ```bash
107
- # Execute all tasks in deploy.rb
108
- $ kdeploy execute deploy.rb
109
-
110
- # Execute a specific task
111
- $ kdeploy execute deploy.rb deploy_web
110
+ kdeploy execute deploy.rb
112
111
  ```
113
112
 
114
113
  ## 📖 Usage Guide
@@ -156,19 +156,6 @@ module Kdeploy
156
156
  def create_readme
157
157
  File.write(File.join(@target_dir, 'README.md'), <<~MD)
158
158
  # Deployment Project
159
- ```
160
- _ _
161
- /\ /\__| | ___ _ __ | | ___ _ _
162
- / //_/ _` |/ _ \ '_ \| |/ _ \| | | |
163
- / __ \ (_| | __/ |_) | | (_) | |_| |
164
- \/ \/\__,_|\___| .__/|_|\___/ \__, |
165
- |_| |___/
166
-
167
-
168
- ⚡ Lightweight Agentless Deployment Tool
169
- 🚀 Deploy with confidence, scale with ease
170
-
171
- ```
172
159
 
173
160
  This is a deployment project created with Kdeploy.
174
161
 
@@ -226,9 +213,9 @@ module Kdeploy
226
213
  2. Run tasks in the order they were defined
227
214
  3. Show task name before each task execution
228
215
  4. Display color-coded output for better readability:
229
- - 🟢 Green: Normal output and success messages
230
- - 🔴 Red: Errors and failure messages
231
- - 🟡 Yellow: Warnings and notices
216
+ - 🟢 Green: Normal output and success messages
217
+ - 🔴 Red: Errors and failure messages
218
+ - 🟡 Yellow: Warnings and notices
232
219
 
233
220
  ### Available Tasks
234
221
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-06-30 00:00:00.000000000 Z
11
+ date: 2025-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -177,7 +177,6 @@ files:
177
177
  - README.md
178
178
  - exe/kdeploy
179
179
  - ext/mkrf_conf.rb
180
- - k.md
181
180
  - lib/kdeploy.rb
182
181
  - lib/kdeploy/banner.rb
183
182
  - lib/kdeploy/cli.rb
data/k.md DELETED
@@ -1,149 +0,0 @@
1
- 以下是将 Kdeploy 项目的开发需求整理成的标准 Markdown 格式文档,可保存为 `dev_requirements.md`:
2
-
3
- ---
4
-
5
- ```markdown
6
- # 📦 Kdeploy 开发需求文档
7
-
8
- > **项目名称**:Kdeploy
9
- > **项目类型**:Ruby Gem
10
- > **定位**:轻量级 agentless 运维部署工具
11
- > **灵感来源**:Ansible、Chef、Puppet
12
- > **目标用户**:DevOps、SRE、系统运维工程师
13
-
14
- ---
15
-
16
- ## 🧭 项目目标
17
-
18
- - 提供 **无 agent** 的远程部署解决方案
19
- - 使用 **优雅的 Ruby DSL** 编写部署任务
20
- - 支持任务的 **并发执行**
21
- - 能够进行任务 **状态统计与结果输出**
22
- - 管理 **完整的部署生命周期**(准备、执行、清理、回滚等)
23
- - 简洁、轻量、便于嵌入其他工具链
24
- - 可支持 **多主机、多环境配置管理**
25
-
26
- ---
27
-
28
- ## 📁 项目结构
29
-
30
- ```
31
-
32
- kdeploy/
33
- ├── bin/
34
- │ └── kdeploy # 主执行文件
35
- ├── lib/
36
- │ ├── kdeploy/
37
- │ │ ├── dsl.rb # DSL 定义
38
- │ │ ├── executor.rb # 并发执行器
39
- │ │ ├── inventory.rb # 主机清单管理
40
- │ │ ├── lifecycle.rb # 生命周期管理
41
- │ │ ├── logger.rb # 日志与输出
42
- │ │ └── version.rb
43
- │ └── kdeploy.rb # 主入口
44
- ├── tasks/
45
- │ └── deploy.rb # 示例任务(用户自定义)
46
- ├── spec/
47
- │ └── kdeploy\_spec.rb # RSpec 测试
48
- ├── kdeploy.gemspec
49
- └── README.md
50
-
51
- ````
52
-
53
- ---
54
-
55
- ## 🔧 功能模块设计
56
-
57
- ### 1. DSL 任务定义
58
-
59
- ```ruby
60
- host 'web01', user: 'ubuntu', ip: '10.0.0.1'
61
-
62
- task :deploy_web do
63
- run 'sudo systemctl stop nginx'
64
- upload './nginx.conf', '/etc/nginx/nginx.conf'
65
- run 'sudo systemctl start nginx'
66
- end
67
- ````
68
-
69
- ### 2. 并发执行器
70
-
71
- * 线程池并发执行远程任务
72
- * 自动记录成功/失败状态
73
- * 支持最大并发数限制
74
-
75
- ### 3. 生命周期管理
76
-
77
- * `prepare`:初始化(如环境检查)
78
- * `run`:主要任务执行
79
- * `cleanup`:清理临时文件或状态
80
- * `rollback`:失败回滚(可选)
81
-
82
- ### 4. 主机清单
83
-
84
- 支持静态或动态清单,如:
85
-
86
- ```ruby
87
- inventory do
88
- host 'web01', user: 'ubuntu', ip: '10.0.0.1'
89
- host 'db01', user: 'root', ip: '10.0.0.2'
90
- end
91
- ```
92
-
93
- ### 5. 输出日志与状态统计
94
-
95
- * 控制台美化输出(使用 `pastel`、`tty-table` 等)
96
- * 最终报告:执行成功/失败主机、任务耗时、回滚信息等
97
-
98
- ---
99
-
100
- ## 🖥️ 命令行工具设计
101
-
102
- 执行文件:`bin/kdeploy`
103
-
104
- ```bash
105
- kdeploy run tasks/deploy.rb --limit web01,web02 --parallel 5 --dry-run
106
- ```
107
-
108
- | 参数 | 说明 |
109
- | ------------- | ------------- |
110
- | `run` | 执行某个 DSL 任务文件 |
111
- | `--limit` | 限定主机 |
112
- | `--parallel` | 设置并发线程数 |
113
- | `--dry-run` | 预览任务,不真正执行 |
114
- | `--rollback` | 启动回滚 |
115
- | `--inventory` | 使用特定主机清单文件 |
116
-
117
- ---
118
-
119
- ## 🧩 可扩展性设计
120
-
121
- * 支持插件机制:可注册自定义任务类型
122
- * 可支持其他协议(如 WinRM、Docker、Kubernetes 等)
123
- * 日后可支持多环境配置(dev/stage/prod)
124
- * 支持本地/远程日志聚合
125
-
126
- ---
127
-
128
- ## 📦 开发计划建议
129
-
130
- | 阶段 | 内容 |
131
- | ---------- | ----------------------------------------- |
132
- | 1️⃣ 初始化 | 使用 `bundle gem .` 生成项目骨架,添加执行文件 |
133
- | 2️⃣ DSL 实现 | 定义基本任务语法(`host`, `task`, `run`, `upload`) |
134
- | 3️⃣ SSH 执行 | 实现基础 SSH 执行器(使用 `net-ssh`) |
135
- | 4️⃣ 并发执行 | 引入线程池或 `concurrent-ruby` |
136
- | 5️⃣ 生命周期 | 支持 prepare/run/cleanup/rollback 阶段 |
137
- | 6️⃣ 状态统计 | 记录执行状态并输出汇总表 |
138
- | 7️⃣ CLI 工具 | 实现 `bin/kdeploy` 命令入口 |
139
- | 8️⃣ 测试与发布 | 使用 RSpec 添加测试,推送到 RubyGems |
140
-
141
- ---
142
-
143
- ## 📝 初始化命令
144
-
145
- ```bash
146
- bundle gem . --test=rspec --mit --coc --no-ext
147
- ```
148
-
149
-