shipfe 1.1.1 → 1.1.3

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.
Files changed (170) hide show
  1. package/bin/shipfe +0 -0
  2. package/package.json +5 -1
  3. package/.github/workflows/deploy.yml +0 -46
  4. package/.github/workflows/release.yml +0 -51
  5. package/.vscode/settings.json +0 -5
  6. package/README_CN.md +0 -41
  7. package/docs/.vitepress/cache/deps/@theme_index.js +0 -275
  8. package/docs/.vitepress/cache/deps/@theme_index.js.map +0 -7
  9. package/docs/.vitepress/cache/deps/_metadata.json +0 -40
  10. package/docs/.vitepress/cache/deps/chunk-BRNHR3LR.js +0 -9719
  11. package/docs/.vitepress/cache/deps/chunk-BRNHR3LR.js.map +0 -7
  12. package/docs/.vitepress/cache/deps/chunk-H6MPEGKE.js +0 -12877
  13. package/docs/.vitepress/cache/deps/chunk-H6MPEGKE.js.map +0 -7
  14. package/docs/.vitepress/cache/deps/package.json +0 -3
  15. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -4505
  16. package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
  17. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -583
  18. package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
  19. package/docs/.vitepress/cache/deps/vue.js +0 -347
  20. package/docs/.vitepress/cache/deps/vue.js.map +0 -7
  21. package/docs/.vitepress/config.ts +0 -120
  22. package/docs/.vitepress/dist/404.html +0 -22
  23. package/docs/.vitepress/dist/assets/app.DZUgfPE2.js +0 -1
  24. package/docs/.vitepress/dist/assets/chunks/framework.BeaujayP.js +0 -19
  25. package/docs/.vitepress/dist/assets/chunks/theme.CNyaCki0.js +0 -1
  26. package/docs/.vitepress/dist/assets/commands_deploy.md.cybIRa1n.js +0 -17
  27. package/docs/.vitepress/dist/assets/commands_deploy.md.cybIRa1n.lean.js +0 -1
  28. package/docs/.vitepress/dist/assets/commands_init.md.Da652so5.js +0 -2
  29. package/docs/.vitepress/dist/assets/commands_init.md.Da652so5.lean.js +0 -1
  30. package/docs/.vitepress/dist/assets/commands_rollback.md.C0zKmFtz.js +0 -7
  31. package/docs/.vitepress/dist/assets/commands_rollback.md.C0zKmFtz.lean.js +0 -1
  32. package/docs/.vitepress/dist/assets/config_auth.md.hvDhtWY8.js +0 -56
  33. package/docs/.vitepress/dist/assets/config_auth.md.hvDhtWY8.lean.js +0 -1
  34. package/docs/.vitepress/dist/assets/config_overview.md.DAQclMJL.js +0 -34
  35. package/docs/.vitepress/dist/assets/config_overview.md.DAQclMJL.lean.js +0 -1
  36. package/docs/.vitepress/dist/assets/config_schema.md.Bv5TuD6E.js +0 -1
  37. package/docs/.vitepress/dist/assets/config_schema.md.Bv5TuD6E.lean.js +0 -1
  38. package/docs/.vitepress/dist/assets/config_sub-env.md.DSUt0Nyq.js +0 -26
  39. package/docs/.vitepress/dist/assets/config_sub-env.md.DSUt0Nyq.lean.js +0 -1
  40. package/docs/.vitepress/dist/assets/features_atomic.md.Cszqfb8O.js +0 -22
  41. package/docs/.vitepress/dist/assets/features_atomic.md.Cszqfb8O.lean.js +0 -1
  42. package/docs/.vitepress/dist/assets/features_cleanup.md.D1j3LEm1.js +0 -20
  43. package/docs/.vitepress/dist/assets/features_cleanup.md.D1j3LEm1.lean.js +0 -1
  44. package/docs/.vitepress/dist/assets/features_shared-assets.md.ChpQD81r.js +0 -26
  45. package/docs/.vitepress/dist/assets/features_shared-assets.md.ChpQD81r.lean.js +0 -1
  46. package/docs/.vitepress/dist/assets/features_snapshot.md.Bddk9nNL.js +0 -24
  47. package/docs/.vitepress/dist/assets/features_snapshot.md.Bddk9nNL.lean.js +0 -1
  48. package/docs/.vitepress/dist/assets/index.md.DqmDY2QI.js +0 -1
  49. package/docs/.vitepress/dist/assets/index.md.DqmDY2QI.lean.js +0 -1
  50. package/docs/.vitepress/dist/assets/install.md.CblrJsha.js +0 -1
  51. package/docs/.vitepress/dist/assets/install.md.CblrJsha.lean.js +0 -1
  52. package/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  53. package/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  54. package/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  55. package/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  56. package/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  57. package/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  58. package/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  59. package/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  60. package/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  61. package/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  62. package/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  63. package/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  64. package/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  65. package/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  66. package/docs/.vitepress/dist/assets/license.md.hVRT8__d.js +0 -1
  67. package/docs/.vitepress/dist/assets/license.md.hVRT8__d.lean.js +0 -1
  68. package/docs/.vitepress/dist/assets/quick-start.md.C06xD920.js +0 -23
  69. package/docs/.vitepress/dist/assets/quick-start.md.C06xD920.lean.js +0 -1
  70. package/docs/.vitepress/dist/assets/style.DES0mfMn.css +0 -1
  71. package/docs/.vitepress/dist/assets/troubleshooting.md.DLP5r-7N.js +0 -1
  72. package/docs/.vitepress/dist/assets/troubleshooting.md.DLP5r-7N.lean.js +0 -1
  73. package/docs/.vitepress/dist/assets/zh_commands_deploy.md.BbKuBIij.js +0 -9
  74. package/docs/.vitepress/dist/assets/zh_commands_deploy.md.BbKuBIij.lean.js +0 -1
  75. package/docs/.vitepress/dist/assets/zh_commands_init.md.Dc_WYD8D.js +0 -18
  76. package/docs/.vitepress/dist/assets/zh_commands_init.md.Dc_WYD8D.lean.js +0 -1
  77. package/docs/.vitepress/dist/assets/zh_commands_rollback.md.Cdvwk1lB.js +0 -6
  78. package/docs/.vitepress/dist/assets/zh_commands_rollback.md.Cdvwk1lB.lean.js +0 -1
  79. package/docs/.vitepress/dist/assets/zh_config_auth.md.BytNcdS4.js +0 -44
  80. package/docs/.vitepress/dist/assets/zh_config_auth.md.BytNcdS4.lean.js +0 -1
  81. package/docs/.vitepress/dist/assets/zh_config_overview.md.CvAKxlb5.js +0 -45
  82. package/docs/.vitepress/dist/assets/zh_config_overview.md.CvAKxlb5.lean.js +0 -1
  83. package/docs/.vitepress/dist/assets/zh_config_schema.md.CTCn0g9X.js +0 -67
  84. package/docs/.vitepress/dist/assets/zh_config_schema.md.CTCn0g9X.lean.js +0 -1
  85. package/docs/.vitepress/dist/assets/zh_config_sub-env.md.Ce3xOEsi.js +0 -167
  86. package/docs/.vitepress/dist/assets/zh_config_sub-env.md.Ce3xOEsi.lean.js +0 -1
  87. package/docs/.vitepress/dist/assets/zh_features_atomic.md.DUhJ_qq0.js +0 -42
  88. package/docs/.vitepress/dist/assets/zh_features_atomic.md.DUhJ_qq0.lean.js +0 -1
  89. package/docs/.vitepress/dist/assets/zh_features_cleanup.md.CEgw587m.js +0 -50
  90. package/docs/.vitepress/dist/assets/zh_features_cleanup.md.CEgw587m.lean.js +0 -1
  91. package/docs/.vitepress/dist/assets/zh_features_shared-assets.md.DZhvWCTp.js +0 -26
  92. package/docs/.vitepress/dist/assets/zh_features_shared-assets.md.DZhvWCTp.lean.js +0 -1
  93. package/docs/.vitepress/dist/assets/zh_features_snapshot.md.Bkqgn7lu.js +0 -39
  94. package/docs/.vitepress/dist/assets/zh_features_snapshot.md.Bkqgn7lu.lean.js +0 -1
  95. package/docs/.vitepress/dist/assets/zh_index.md.DKRf1R-g.js +0 -1
  96. package/docs/.vitepress/dist/assets/zh_index.md.DKRf1R-g.lean.js +0 -1
  97. package/docs/.vitepress/dist/assets/zh_install.md.0LCLPI3L.js +0 -41
  98. package/docs/.vitepress/dist/assets/zh_install.md.0LCLPI3L.lean.js +0 -1
  99. package/docs/.vitepress/dist/assets/zh_license.md.BUZ74dvK.js +0 -1
  100. package/docs/.vitepress/dist/assets/zh_license.md.BUZ74dvK.lean.js +0 -1
  101. package/docs/.vitepress/dist/assets/zh_quick-start.md.Bl-Larcu.js +0 -19
  102. package/docs/.vitepress/dist/assets/zh_quick-start.md.Bl-Larcu.lean.js +0 -1
  103. package/docs/.vitepress/dist/assets/zh_troubleshooting.md.DHyCAfy2.js +0 -1
  104. package/docs/.vitepress/dist/assets/zh_troubleshooting.md.DHyCAfy2.lean.js +0 -1
  105. package/docs/.vitepress/dist/commands/deploy.html +0 -41
  106. package/docs/.vitepress/dist/commands/init.html +0 -26
  107. package/docs/.vitepress/dist/commands/rollback.html +0 -31
  108. package/docs/.vitepress/dist/config/auth.html +0 -80
  109. package/docs/.vitepress/dist/config/overview.html +0 -58
  110. package/docs/.vitepress/dist/config/schema.html +0 -25
  111. package/docs/.vitepress/dist/config/sub-env.html +0 -50
  112. package/docs/.vitepress/dist/features/atomic.html +0 -46
  113. package/docs/.vitepress/dist/features/cleanup.html +0 -44
  114. package/docs/.vitepress/dist/features/shared-assets.html +0 -50
  115. package/docs/.vitepress/dist/features/snapshot.html +0 -48
  116. package/docs/.vitepress/dist/hashmap.json +0 -1
  117. package/docs/.vitepress/dist/index.html +0 -25
  118. package/docs/.vitepress/dist/install.html +0 -25
  119. package/docs/.vitepress/dist/license.html +0 -25
  120. package/docs/.vitepress/dist/quick-start.html +0 -47
  121. package/docs/.vitepress/dist/troubleshooting.html +0 -25
  122. package/docs/.vitepress/dist/vp-icons.css +0 -0
  123. package/docs/.vitepress/dist/zh/commands/deploy.html +0 -33
  124. package/docs/.vitepress/dist/zh/commands/init.html +0 -42
  125. package/docs/.vitepress/dist/zh/commands/rollback.html +0 -30
  126. package/docs/.vitepress/dist/zh/config/auth.html +0 -68
  127. package/docs/.vitepress/dist/zh/config/overview.html +0 -69
  128. package/docs/.vitepress/dist/zh/config/schema.html +0 -91
  129. package/docs/.vitepress/dist/zh/config/sub-env.html +0 -191
  130. package/docs/.vitepress/dist/zh/features/atomic.html +0 -66
  131. package/docs/.vitepress/dist/zh/features/cleanup.html +0 -74
  132. package/docs/.vitepress/dist/zh/features/shared-assets.html +0 -50
  133. package/docs/.vitepress/dist/zh/features/snapshot.html +0 -63
  134. package/docs/.vitepress/dist/zh/index.html +0 -25
  135. package/docs/.vitepress/dist/zh/install.html +0 -65
  136. package/docs/.vitepress/dist/zh/license.html +0 -25
  137. package/docs/.vitepress/dist/zh/quick-start.html +0 -43
  138. package/docs/.vitepress/dist/zh/troubleshooting.html +0 -25
  139. package/docs/commands/deploy.md +0 -46
  140. package/docs/commands/init.md +0 -27
  141. package/docs/commands/rollback.md +0 -45
  142. package/docs/config/auth.md +0 -112
  143. package/docs/config/overview.md +0 -63
  144. package/docs/config/schema.md +0 -52
  145. package/docs/config/sub-env.md +0 -62
  146. package/docs/features/atomic.md +0 -67
  147. package/docs/features/cleanup.md +0 -80
  148. package/docs/features/shared-assets.md +0 -72
  149. package/docs/features/snapshot.md +0 -58
  150. package/docs/index.md +0 -48
  151. package/docs/install.md +0 -21
  152. package/docs/license.md +0 -23
  153. package/docs/quick-start.md +0 -98
  154. package/docs/troubleshooting.md +0 -88
  155. package/docs/zh/commands/deploy.md +0 -127
  156. package/docs/zh/commands/init.md +0 -76
  157. package/docs/zh/commands/rollback.md +0 -115
  158. package/docs/zh/config/auth.md +0 -195
  159. package/docs/zh/config/overview.md +0 -153
  160. package/docs/zh/config/schema.md +0 -253
  161. package/docs/zh/config/sub-env.md +0 -293
  162. package/docs/zh/features/atomic.md +0 -249
  163. package/docs/zh/features/cleanup.md +0 -241
  164. package/docs/zh/features/shared-assets.md +0 -72
  165. package/docs/zh/features/snapshot.md +0 -186
  166. package/docs/zh/index.md +0 -65
  167. package/docs/zh/install.md +0 -160
  168. package/docs/zh/license.md +0 -23
  169. package/docs/zh/quick-start.md +0 -109
  170. package/docs/zh/troubleshooting.md +0 -88
@@ -1,186 +0,0 @@
1
- # 资源快照
2
-
3
- 每个发布都会生成包含完整文件清单的快照,用于审计和回滚验证。
4
-
5
- ## 快照内容
6
-
7
- - 所有部署文件及其哈希值
8
- - 共享资源引用
9
- - 部署时间戳和元数据
10
- - 文件权限和大小信息
11
-
12
- ## 快照文件位置
13
-
14
- ```
15
- releases/20260304_120100/
16
- ├── files/
17
- │ ├── index.html
18
- │ └── app.js -> ../../shared/assets/abc123def456.js
19
- ├── snapshot.json
20
- └── metadata.json
21
- ```
22
-
23
- ## snapshot.json 示例
24
-
25
- ```json
26
- {
27
- "timestamp": "20260304_120100",
28
- "files": {
29
- "index.html": {
30
- "hash": "a1b2c3d4e5f6...",
31
- "size": 1024,
32
- "permissions": "644"
33
- },
34
- "app.js": {
35
- "shared_hash": "abc123def456.js",
36
- "size": 51200,
37
- "permissions": "644"
38
- }
39
- }
40
- }
41
- ```
42
-
43
- ## metadata.json 示例
44
-
45
- ```json
46
- {
47
- "build_command": "npm run build",
48
- "deployed_by": "user",
49
- "deployed_at": "2026-03-04T12:01:00Z"
50
- }
51
- ```
52
-
53
- ## 快照用途
54
-
55
- ### 审计追踪
56
-
57
- - 记录每次部署的文件清单
58
- - 验证文件完整性
59
- - 追踪部署历史
60
-
61
- ### 回滚验证
62
-
63
- - 确保回滚到的版本文件完整
64
- - 验证共享资源引用正确
65
- - 检查文件权限设置
66
-
67
- ### 问题诊断
68
-
69
- - 比较不同版本的文件差异
70
- - 识别部署问题
71
- - 分析性能变化
72
-
73
- ## 快照生成时机
74
-
75
- - **部署时**:每次成功部署后生成
76
- - **回滚时**:验证目标版本的快照
77
- - **清理时**:检查要删除版本的快照
78
-
79
- ## 快照验证
80
-
81
- Shipfe 会验证快照的完整性:
82
-
83
- - 检查文件是否存在
84
- - 验证哈希值匹配
85
- - 确认权限设置正确
86
- - 验证共享资源链接
87
-
88
- ## 快照存储
89
-
90
- 快照文件存储在每个发布目录中:
91
-
92
- - `snapshot.json` - 文件清单和哈希
93
- - `metadata.json` - 部署元数据
94
-
95
- ## 查看快照
96
-
97
- ### 本地查看
98
-
99
- ```bash
100
- # SSH到服务器查看快照
101
- ssh user@server "cat /var/www/myapp/releases/20260304_120100/snapshot.json"
102
- ```
103
-
104
- ### 编程访问
105
-
106
- ```javascript
107
- const fs = require('fs');
108
- const snapshot = JSON.parse(fs.readFileSync('snapshot.json', 'utf8'));
109
-
110
- console.log('Files in this release:');
111
- Object.entries(snapshot.files).forEach(([file, info]) => {
112
- console.log(`${file}: ${info.hash} (${info.size} bytes)`);
113
- });
114
- ```
115
-
116
- ## 快照与共享资源
117
-
118
- 当启用共享资源时,快照包含特殊处理:
119
-
120
- ```json
121
- {
122
- "files": {
123
- "app.js": {
124
- "shared_hash": "abc123def456.js",
125
- "size": 51200,
126
- "permissions": "644"
127
- }
128
- }
129
- }
130
- ```
131
-
132
- - `shared_hash` 字段标识共享资源
133
- - 实际文件通过硬链接引用共享存储
134
-
135
- ## 性能考虑
136
-
137
- - 快照文件很小,通常只有几KB
138
- - 哈希计算只对实际文件进行
139
- - 快照验证快速且轻量
140
-
141
- ## 故障排除
142
-
143
- ### 快照创建失败
144
-
145
- ```
146
- Error: Failed to create snapshot
147
- ```
148
-
149
- **原因**:
150
- - 磁盘空间不足
151
- - 文件权限问题
152
- - 哈希计算失败
153
-
154
- **解决方案**:
155
- - 检查磁盘空间
156
- - 验证文件权限
157
- - 查看详细错误日志
158
-
159
- ### 快照验证失败
160
-
161
- ```
162
- Warning: Snapshot validation failed
163
- ```
164
-
165
- **原因**:
166
- - 文件被修改
167
- - 权限被改变
168
- - 共享资源链接损坏
169
-
170
- **解决方案**:
171
- - 检查文件完整性
172
- - 修复文件权限
173
- - 重新创建共享资源链接
174
-
175
- ### 快照文件丢失
176
-
177
- 如果快照文件丢失:
178
-
179
- - 无法验证版本完整性
180
- - 回滚可能失败
181
- - 共享资源清理受影响
182
-
183
- **恢复**:
184
- - 从备份恢复
185
- - 重新生成快照(如果可能)
186
- - 手动验证文件
package/docs/zh/index.md DELETED
@@ -1,65 +0,0 @@
1
- ---
2
- home: true
3
- heroImage: /logo.png
4
- heroText: Shipfe
5
- tagline: 现代化的零停机部署工具
6
- actionText: 快速开始 →
7
- actionLink: /zh/quick-start
8
- features:
9
- - title: 零停机部署
10
- details: 原子化部署确保应用在部署过程中保持可用性,无缝切换到新版本。
11
- - title: 智能回滚
12
- details: 一键回滚到之前的稳定版本,包含完整的文件快照和元数据。
13
- - title: 资源共享
14
- details: 通过文件哈希去重减少磁盘使用和网络传输,提升部署效率。
15
- - title: 自动清理
16
- details: 可配置的自动清理机制,保持服务器整洁并节省存储空间。
17
- footer: MIT Licensed | Copyright © 2024 Master-Jian
18
- ---
19
-
20
- ## 快速导航
21
-
22
- <div class="features">
23
- <div class="feature">
24
- <h3>🚀 快速开始</h3>
25
- <p>5分钟内完成安装和首次部署</p>
26
- <a href="/zh/quick-start">开始使用</a>
27
- </div>
28
- <div class="feature">
29
- <h3>⚙️ 配置指南</h3>
30
- <p>了解所有配置选项和最佳实践</p>
31
- <a href="/zh/config/overview">配置文档</a>
32
- </div>
33
- <div class="feature">
34
- <h3>📚 命令参考</h3>
35
- <p>完整的命令行工具使用说明</p>
36
- <a href="/zh/commands/init">命令文档</a>
37
- </div>
38
- </div>
39
-
40
- ## 核心特性
41
-
42
- ### 原子化部署
43
- 每次部署都是原子操作,要么完全成功,要么完全失败,确保应用稳定性。
44
-
45
- ### 智能资源管理
46
- - **共享资源**:相同文件只存储一次,通过硬链接节省磁盘空间
47
- - **增量部署**:只传输变更的文件,减少网络开销
48
- - **自动清理**:可配置的清理策略,防止磁盘空间浪费
49
-
50
- ### 完善的回滚机制
51
- - **快照记录**:每个部署生成完整文件清单和元数据
52
- - **一键回滚**:快速恢复到任意历史版本
53
- - **状态验证**:确保回滚后的应用状态正确
54
-
55
- ## 适用场景
56
-
57
- - **Web应用**:前端应用、API服务、微服务
58
- - **静态站点**:博客、文档站点、营销页面
59
- - **混合部署**:包含静态资源和动态服务的应用
60
-
61
- ## 系统要求
62
-
63
- - **服务器**:Linux/macOS/Windows,支持SSH访问
64
- - **本地环境**:Node.js 16+,支持SSH密钥认证
65
- - **网络**:稳定的SSH连接,支持文件传输
@@ -1,160 +0,0 @@
1
- # 安装
2
-
3
- Shipfe 支持多种安装方式,选择最适合您的方式。
4
-
5
- ## 系统要求
6
-
7
- - **操作系统**: Linux, macOS, Windows
8
- - **Node.js**: 版本 16 或更高
9
- - **SSH**: 支持密钥认证
10
- - **服务器**: 支持SSH访问的Linux/macOS服务器
11
-
12
- ## 方式一:npm安装(推荐)
13
-
14
- ### 全局安装
15
-
16
- ```bash
17
- npm install -g shipfe
18
- ```
19
-
20
- ### 项目级安装
21
-
22
- ```bash
23
- npm install --save-dev shipfe
24
- ```
25
-
26
- 然后在 `package.json` 中添加脚本:
27
-
28
- ```json
29
- {
30
- "scripts": {
31
- "deploy": "shipfe deploy",
32
- "rollback": "shipfe rollback"
33
- }
34
- }
35
- ```
36
-
37
- ## 方式二:从源码构建
38
-
39
- ### 克隆仓库
40
-
41
- ```bash
42
- git clone https://github.com/Master-Jian/shipfe.git
43
- cd shipfe
44
- ```
45
-
46
- ### 安装Rust
47
-
48
- 如果还没有安装Rust:
49
-
50
- ```bash
51
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
52
- source ~/.cargo/env
53
- ```
54
-
55
- ### 构建和安装
56
-
57
- ```bash
58
- # 构建发布版本
59
- cargo build --release
60
-
61
- # 安装到系统路径
62
- cp target/release/shipfe /usr/local/bin/shipfe
63
-
64
- # 或者安装到用户目录
65
- cp target/release/shipfe ~/.local/bin/shipfe
66
- ```
67
-
68
- ### 验证安装
69
-
70
- ```bash
71
- shipfe --version
72
- ```
73
-
74
- ## 方式三:下载预构建二进制文件
75
-
76
- 访问 [GitHub Releases](https://github.com/Master-Jian/shipfe/releases) 下载适合您平台的二进制文件。
77
-
78
- ```bash
79
- # 下载并安装(以Linux x64为例)
80
- wget https://github.com/Master-Jian/shipfe/releases/download/v1.0.0/shipfe-linux-x64
81
- chmod +x shipfe-linux-x64
82
- sudo mv shipfe-linux-x64 /usr/local/bin/shipfe
83
- ```
84
-
85
- ## 配置自动补全(可选)
86
-
87
- ### Bash
88
-
89
- ```bash
90
- # 添加到 ~/.bashrc
91
- echo 'source <(shipfe completion bash)' >> ~/.bashrc
92
- source ~/.bashrc
93
- ```
94
-
95
- ### Zsh
96
-
97
- ```bash
98
- # 添加到 ~/.zshrc
99
- echo 'source <(shipfe completion zsh)' >> ~/.zshrc
100
- source ~/.zshrc
101
- ```
102
-
103
- ### Fish
104
-
105
- ```bash
106
- # 添加到 ~/.config/fish/config.fish
107
- echo 'shipfe completion fish | source' >> ~/.config/fish/config.fish
108
- ```
109
-
110
- ## 验证安装
111
-
112
- 运行以下命令验证安装是否成功:
113
-
114
- ```bash
115
- # 检查版本
116
- shipfe --version
117
-
118
- # 查看帮助
119
- shipfe --help
120
-
121
- # 查看所有可用命令
122
- shipfe --help
123
- ```
124
-
125
- ## 故障排除
126
-
127
- ### 权限问题
128
-
129
- 如果遇到权限错误:
130
-
131
- ```bash
132
- # 使用sudo安装(不推荐)
133
- sudo npm install -g shipfe
134
-
135
- # 或者安装到用户目录
136
- npm config set prefix ~/.npm-global
137
- export PATH=~/.npm-global/bin:$PATH
138
- ```
139
-
140
- ### 网络问题
141
-
142
- 如果npm安装失败,尝试使用国内镜像:
143
-
144
- ```bash
145
- npm config set registry https://registry.npmmirror.com
146
- npm install -g shipfe
147
- ```
148
-
149
- ### Rust编译问题
150
-
151
- 如果源码构建失败:
152
-
153
- ```bash
154
- # 更新Rust
155
- rustup update
156
-
157
- # 清理并重新构建
158
- cargo clean
159
- cargo build --release
160
- ```
@@ -1,23 +0,0 @@
1
- # 许可证
2
-
3
- MIT License
4
-
5
- Copyright (c) 2024 Master-Jian
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- SOFTWARE.
@@ -1,109 +0,0 @@
1
- # 快速开始
2
-
3
- 本指南将帮助您在5分钟内完成Shipfe的安装和首次部署。
4
-
5
- ## 安装
6
-
7
- ### 使用npm安装
8
-
9
- ```bash
10
- npm install -g shipfe
11
- ```
12
-
13
- ### 从源码构建
14
-
15
- ```bash
16
- git clone https://github.com/Master-Jian/shipfe.git
17
- cd shipfe
18
- cargo build --release
19
- cp target/release/shipfe /usr/local/bin/shipfe
20
- ```
21
-
22
- ## 初始化项目
23
-
24
- 在您的项目根目录下运行:
25
-
26
- ```bash
27
- shipfe init
28
- ```
29
-
30
- 这将创建 `shipfe.config.json` 配置文件。
31
-
32
- ## 配置
33
-
34
- 编辑 `shipfe.config.json`:
35
-
36
- ```json
37
- {
38
- "remote_host": "your-server.com",
39
- "remote_user": "deploy",
40
- "remote_path": "/var/www/myapp",
41
- "local_path": "./dist",
42
- "keep_releases": 5,
43
- "build_command": "npm run build"
44
- }
45
- ```
46
-
47
- ### 配置说明
48
-
49
- - `remote_host`: 服务器地址
50
- - `remote_user`: SSH用户名
51
- - `remote_path`: 服务器部署目录
52
- - `local_path`: 本地构建输出目录
53
- - `keep_releases`: 保留的发布版本数量
54
- - `build_command`: 构建命令
55
-
56
- ## SSH密钥配置
57
-
58
- 确保您的SSH密钥已添加到服务器:
59
-
60
- ```bash
61
- # 本地生成SSH密钥(如果还没有)
62
- ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
63
-
64
- # 复制公钥到服务器
65
- ssh-copy-id user@your-server.com
66
- ```
67
-
68
- ## 首次部署
69
-
70
- 运行构建和部署:
71
-
72
- ```bash
73
- shipfe deploy
74
- ```
75
-
76
- Shipfe将:
77
- 1. 执行构建命令
78
- 2. 创建新的发布目录
79
- 3. 上传文件到服务器
80
- 4. 原子化切换到新版本
81
- 5. 清理旧版本
82
-
83
- ## 验证部署
84
-
85
- 检查部署状态:
86
-
87
- ```bash
88
- # 查看服务器上的发布
89
- ssh user@server "ls -la /var/www/myapp/releases/"
90
-
91
- # 检查当前符号链接
92
- ssh user@server "ls -la /var/www/myapp/current"
93
- ```
94
-
95
- ## 回滚(如果需要)
96
-
97
- 如果部署出现问题,可以快速回滚:
98
-
99
- ```bash
100
- shipfe rollback
101
- ```
102
-
103
- 这将自动切换到上一个稳定版本。
104
-
105
- ## 下一步
106
-
107
- - [配置详解](/zh/config/overview) - 了解所有配置选项
108
- - [命令参考](/zh/commands/deploy) - 掌握所有命令
109
- - [故障排除](/zh/troubleshooting) - 解决常见问题
@@ -1,88 +0,0 @@
1
- # 故障排除
2
-
3
- ## 常见问题
4
-
5
- ### 1. 权限拒绝错误
6
-
7
- ```
8
- Error: Permission denied (publickey)
9
- ```
10
-
11
- **解决方案:**
12
- - 验证 SSH 密钥已添加到服务器的 `~/.ssh/authorized_keys`
13
- - 检查 SSH 密钥权限:`chmod 600 ~/.ssh/id_rsa`
14
- - 测试 SSH 连接:`ssh user@host`
15
-
16
- ### 2. 共享资源不工作
17
-
18
- ```
19
- Warning: Failed to create hard link for shared asset
20
- ```
21
-
22
- **解决方案:**
23
- - 确保配置中 `enable_shared: true`
24
- - 检查服务器文件系统支持硬链接
25
- - 验证 shared 目录的写入权限
26
-
27
- ### 3. 清理不工作
28
-
29
- ```
30
- Warning: Failed to remove old release
31
- ```
32
-
33
- **解决方案:**
34
- - 检查 releases 目录的文件权限
35
- - 确保没有进程正在使用旧发布文件
36
- - 验证 `keep_releases` 设置正确
37
-
38
- ### 4. 快照创建失败
39
-
40
- ```
41
- Error: Failed to create snapshot
42
- ```
43
-
44
- **解决方案:**
45
- - 检查可用磁盘空间
46
- - 验证 releases 目录的写入权限
47
- - 确保服务器上有 tar 命令
48
-
49
- ## 调试模式
50
-
51
- 启用详细日志:
52
-
53
- ```bash
54
- shipfe deploy --debug
55
- ```
56
-
57
- ## 日志路径
58
-
59
- Shipfe 的日志文件通常位于:
60
-
61
- - 本地:`shipfe.log`
62
- - 服务器:部署目录下的 `shipfe.log`
63
-
64
- 检查日志:
65
-
66
- ```bash
67
- tail -f shipfe.log
68
- ```
69
-
70
- ## 性能优化
71
-
72
- ### 部署缓慢
73
-
74
- - 为大静态文件启用共享资源
75
- - 使用 `hashed_asset_patterns` 针对特定文件
76
- - 考虑从模式中排除大的非更改文件
77
-
78
- ### 磁盘使用过高
79
-
80
- - 减少 `keep_releases` 数量
81
- - 启用共享资源
82
- - 对单发布部署使用 `delete_old: true`
83
-
84
- ### 网络问题
85
-
86
- - 部署前压缩大文件
87
- - 如果支持,使用更快的 SSH 密码
88
- - 考虑在非高峰时段部署