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,62 +0,0 @@
1
- # Sub-environments
2
-
3
- Sub-environments allow deploying multiple applications or different configurations on the same server.
4
-
5
- ## Configuration Structure
6
-
7
- ```json
8
- {
9
- "environments": {
10
- "dev": {
11
- "build_command": "npm run build",
12
- "local_dist_path": "./dist",
13
- "servers": [...],
14
- "sub_environments": {
15
- "admin": {
16
- "build_command": "npm run build:admin",
17
- "remote_deploy_path": "/var/www/dev/admin"
18
- },
19
- "shop": {
20
- "build_command": "npm run build:shop",
21
- "remote_deploy_path": "/var/www/dev/shop"
22
- }
23
- }
24
- }
25
- }
26
- }
27
- ```
28
-
29
- ## Inheritance Rules
30
-
31
- Sub-environments inherit all settings from their parent environment but can override:
32
-
33
- - `build_command`
34
- - `local_dist_path`
35
- - `remote_deploy_path`
36
-
37
- ## Deploying Sub-environments
38
-
39
- ```bash
40
- # Deploy single sub-environment
41
- shipfe deploy --profile dev-admin
42
- shipfe deploy --profile dev-shop
43
-
44
- # Deploy all sub-environments
45
- shipfe deploy --profile dev --all-sub
46
- ```
47
-
48
- ## Directory Structure
49
-
50
- Parent and sub-environments are deployed to different directories:
51
-
52
- ```
53
- /var/www/dev/ # Parent environment
54
- /var/www/dev/admin/ # Sub-environment admin
55
- /var/www/dev/shop/ # Sub-environment shop
56
- ```
57
-
58
- ## Rolling Back Sub-environments
59
-
60
- ```bash
61
- shipfe rollback --profile dev-admin --to 20260303_034945
62
- ```
@@ -1,67 +0,0 @@
1
- # Atomic Deployment
2
-
3
- Atomic deployment enables zero-downtime deployment through symbolic link switching for consistency.
4
-
5
- ## How It Works
6
-
7
- When using `--atomic`, deployment:
8
-
9
- 1. Creates a timestamped release directory: `releases/20260303_034945/`
10
- 2. Uploads files to the new directory
11
- 3. Updates the `current` symbolic link to point to the new directory
12
-
13
- ## Directory Structure
14
-
15
- ```
16
- remote_deploy_path/
17
- ├── releases/
18
- │ ├── 20260303_034945/
19
- │ ├── 20260303_035012/
20
- │ └── 20260303_035045/
21
- └── current -> releases/20260303_035045
22
- ```
23
-
24
- ## Web Server Configuration
25
-
26
- Your web server should serve from `remote_deploy_path/current`.
27
-
28
- ### Nginx Example
29
-
30
- ```nginx
31
- server {
32
- listen 80;
33
- server_name your-domain.com;
34
- root /var/www/prod/current;
35
- index index.html;
36
-
37
- location / {
38
- try_files $uri $uri/ =404;
39
- }
40
- }
41
- ```
42
-
43
- ### Apache Example
44
-
45
- ```apache
46
- <VirtualHost *:80>
47
- ServerName your-domain.com
48
- DocumentRoot /var/www/prod/current
49
- </VirtualHost>
50
- ```
51
-
52
- ## Benefits
53
-
54
- - **Zero Downtime**: Switching happens instantly
55
- - **Atomicity**: Either everything succeeds or everything fails
56
- - **Instant Rollback**: Just change the symbolic link
57
- - **Version Isolation**: Each release is stored independently
58
-
59
- ## Usage
60
-
61
- ```bash
62
- # Atomic deployment to default environment
63
- shipfe deploy --atomic
64
-
65
- # Atomic deployment to specified environment
66
- shipfe deploy --profile prod --atomic
67
- ```
@@ -1,80 +0,0 @@
1
- # Automatic Cleanup
2
-
3
- Shipfe provides configurable automatic cleanup of old releases and unused shared resources.
4
-
5
- ## Configuration Options
6
-
7
- ### `keep_releases` (Recommended)
8
-
9
- ```json
10
- {
11
- "keep_releases": 5,
12
- "delete_old": false
13
- }
14
- ```
15
-
16
- - Keep the most recent 5 releases
17
- - Automatically delete old releases
18
- - Works with shared resource cleanup
19
-
20
- ### `delete_old` (Legacy)
21
-
22
- ```json
23
- {
24
- "delete_old": true
25
- }
26
- ```
27
-
28
- - Delete all old releases after each deployment
29
- - Keep only the current deployment
30
- - Overrides `keep_releases` setting
31
-
32
- ## Cleanup Process
33
-
34
- ### Release Cleanup
35
-
36
- 1. Sort releases by modification time (newest first)
37
- 2. Keep the specified number of recent releases
38
- 3. Completely delete old release directories
39
-
40
- ### Shared Resource Cleanup (when `enable_shared: true`)
41
-
42
- 1. Scan all remaining release snapshots
43
- 2. Collect all currently referenced hashed resources
44
- 3. Delete unreferenced files from `shared/assets/`
45
-
46
- ## Cleanup Behavior Example
47
-
48
- ### Before Cleanup (7 releases)
49
-
50
- ```
51
- releases/
52
- ├── 20260301_100000/ (oldest)
53
- ├── 20260302_100000/
54
- ├── 20260303_100000/
55
- ├── 20260304_100000/
56
- ├── 20260305_100000/
57
- ├── 20260306_100000/
58
- └── 20260307_100000/ (newest, current)
59
- ```
60
-
61
- ### After Cleanup (`keep_releases: 3`)
62
-
63
- ```
64
- releases/
65
- ├── 20260305_100000/ (kept)
66
- ├── 20260306_100000/ (kept)
67
- └── 20260307_100000/ (kept, current)
68
- ```
69
-
70
- *Old releases automatically deleted*
71
-
72
- ## Monitoring Cleanup
73
-
74
- ```bash
75
- # Check current releases
76
- ls -la releases/
77
-
78
- # View cleanup logs in shipfe.log
79
- tail -f shipfe.log | grep -i "cleanup\|remove"
80
- ```
@@ -1,72 +0,0 @@
1
- # Shared Assets
2
-
3
- Shared assets reduce disk usage and network transmission through file hash deduplication.
4
-
5
- ## Enable Shared Assets
6
-
7
- ```json
8
- {
9
- "enable_shared": true,
10
- "hashed_asset_patterns": [
11
- "**/*.js",
12
- "**/*.css",
13
- "**/*.png",
14
- "**/*.jpg",
15
- "**/*.svg",
16
- "**/*.woff2"
17
- ]
18
- }
19
- ```
20
-
21
- ## How It Works
22
-
23
- 1. **File Matching**: Matches files according to `hashed_asset_patterns`
24
- 2. **Hash Calculation**: Calculates SHA256 hash for matching files
25
- 3. **Storage Strategy**:
26
- - Same hash files are stored only once in `shared/assets/` directory
27
- - Filename format: `{hash}.{ext}`, e.g., `abc123def456.js`
28
- 4. **Link Creation**: Creates hard links in release directory pointing to shared files
29
- 5. **Cleanup Mechanism**: Deletes shared files no longer referenced by any release
30
-
31
- ## Shared Assets Reset
32
-
33
- At the start of each deployment, Shipfe automatically clears all existing resources in the `shared/` directory and recreates the `shared/assets/` directory. This ensures each deployment starts from a clean state, avoiding accumulation of old resources and potential conflicts.
34
-
35
- ## Directory Structure Example
36
-
37
- ```
38
- remote_deploy_path/
39
- ├── shared/
40
- │ └── assets/
41
- │ ├── abc123def456.js
42
- │ ├── def789ghi012.css
43
- │ └── hij345klm678.png
44
- ├── releases/
45
- │ ├── 20260304_120000/
46
- │ │ ├── index.html
47
- │ │ ├── app.js -> ../../shared/assets/abc123def456.js
48
- │ │ └── styles.css -> ../../shared/assets/def789ghi012.css
49
- │ └── 20260304_120100/
50
- │ ├── index.html
51
- │ ├── app.js -> ../../shared/assets/abc123def456.js
52
- │ └── styles.css -> ../../shared/assets/def789ghi012.css
53
- └── current -> releases/20260304_120100
54
- ```
55
-
56
- ## Benefits
57
-
58
- - **Reduced Disk Usage**: Same files stored only once
59
- - **Faster Deployments**: Unchanged files don't need re-uploading
60
- - **Bandwidth Savings**: Only new or changed files are transmitted
61
- - **Atomic Updates**: All hard links created simultaneously for consistency
62
-
63
- ## Notes
64
-
65
- - Shared assets require hard link support on the server filesystem
66
- - First enablement hashes all matching files
67
- - Disabling shared doesn't delete existing shared files; manual cleanup required
68
-
69
- ## Use Cases
70
-
71
- - **Enable Shared**: Large apps with frequent deployments and many static resources
72
- - **Disable Shared**: Small apps with infrequent deployments or need for simple debugging
@@ -1,58 +0,0 @@
1
- # Resource Snapshots
2
-
3
- Each deployment generates a snapshot containing a complete file manifest for auditing and rollback verification.
4
-
5
- ## Snapshot Contents
6
-
7
- - All deployed files and their hashes
8
- - Shared resource references
9
- - Deployment timestamp and metadata
10
- - File permissions and size information
11
-
12
- ## Snapshot File Location
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 Example
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 Example
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
- - **调试**:排查部署问题
package/docs/index.md DELETED
@@ -1,48 +0,0 @@
1
- # Shipfe
2
-
3
- [![npm version](https://img.shields.io/npm/v/shipfe.svg)](https://www.npmjs.com/package/shipfe)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![GitHub](https://img.shields.io/badge/GitHub-Master--Jian/shipfe--rust-blue.svg)](https://github.com/Master-Jian/shipfe-rust)
6
-
7
- A powerful, **free**, **Rust-based** web app deployment tool that **doesn't request network**, enabling **one-click static frontend package uploads to servers**. Supports multi-environment and sub-environment deployments with zero-downtime atomic deployment functionality.
8
-
9
- ## Key Features
10
-
11
- - 🚀 **Free & Open Source**: No hidden fees, MIT license
12
- - 🦀 **Rust-Based**: Fast, reliable, memory-safe
13
- - 🔒 **No Network Requests**: Works completely offline, ensuring security and privacy
14
- - ⚡ **One-Click Deployment**: Instantly upload static frontend packages to servers
15
- - 🔄 **Atomic Deployment**: Zero-downtime deployment with automatic rollback
16
- - 🌍 **Multi-Environment Support**: Configure different environments (dev, staging, prod)
17
- - 📦 **Sub-Environment Support**: Deploy multiple apps on the same server
18
- - 🔑 **Flexible Authentication**: SSH keys, passwords, or environment variables
19
- - 📝 **Detailed Logging**: Comprehensive deployment logs for troubleshooting
20
- - 🗂️ **Shared Resource Management**: Cross-release deduplication of hashed static resources
21
- - 📊 **Resource Snapshots**: Generate snapshots with file manifests for deployment auditing
22
- - 🧹 **Automatic Cleanup**: Configurable old release retention and unused resource cleanup
23
- - 🗑️ **Shared Resource Reset**: Automatically clears all shared resources during deployment for clean deployments
24
-
25
- ## Installation
26
-
27
- [Installation Guide](/install)
28
-
29
- ## Quick Start
30
-
31
- 1. Initialize project:
32
- ```bash
33
- shipfe init
34
- ```
35
-
36
- 2. Configure deployment in `shipfe.config.json`
37
-
38
- 3. Deploy:
39
- ```bash
40
- shipfe deploy --profile prod
41
- ```
42
-
43
- ## Quick Links
44
-
45
- - [Quick Start](/quick-start)
46
- - [Config Overview](/config/overview)
47
- - [Deploy Command](/commands/deploy)
48
- - [Rollback Command](/commands/rollback)
package/docs/install.md DELETED
@@ -1,21 +0,0 @@
1
- # Installation
2
-
3
- ## npm Installation
4
-
5
- ```bash
6
- npm install -g shipfe
7
- ```
8
-
9
- ## Verify Installation
10
-
11
- Check version:
12
-
13
- ```bash
14
- shipfe --version
15
- ```
16
-
17
- View help:
18
-
19
- ```bash
20
- shipfe --help
21
- ```
package/docs/license.md DELETED
@@ -1,23 +0,0 @@
1
- # License
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,98 +0,0 @@
1
- # Quick Start
2
-
3
- This page aims to complete a full deployment cycle (init → config → deploy → verify → rollback) with minimal configuration.
4
-
5
- ## 1. Installation
6
-
7
- ```bash
8
- npm install -g shipfe
9
- shipfe --version
10
- ```
11
-
12
- ## 2. Initialize Configuration
13
-
14
- Run in your project root directory:
15
-
16
- ```bash
17
- shipfe init
18
- ```
19
-
20
- This will generate (example):
21
-
22
- ```
23
- shipfe.config.json
24
- ```
25
-
26
- ## 3. Write a Minimal Viable Configuration (Single Server, Single Environment)
27
-
28
- Edit `shipfe.config.json`:
29
-
30
- ```json
31
- {
32
- "keep_releases": 5,
33
- "environments": {
34
- "prod": {
35
- "build_command": "npm run build",
36
- "local_dist_path": "./dist",
37
- "remote_tmp": "/tmp",
38
- "servers": [
39
- {
40
- "host": "YOUR_SERVER_IP",
41
- "port": 22,
42
- "username": "deploy",
43
- "remote_deploy_path": "/var/www/shipfe-demo"
44
- }
45
- ]
46
- }
47
- }
48
- }
49
- ```
50
-
51
- ## 4. First Deployment (Atomic Deployment Recommended)
52
-
53
- ```bash
54
- shipfe deploy --profile prod --atomic
55
- ```
56
-
57
- After deployment, the server directory will typically be:
58
-
59
- ```
60
- /var/www/shipfe-demo/
61
- releases/
62
- 20260304_120100/
63
- current -> releases/20260304_120100
64
- ```
65
-
66
- Your Nginx/static server should serve from:
67
-
68
- ```
69
- /var/www/shipfe-demo/current
70
- ```
71
-
72
- ## 5. Verify Deployment
73
-
74
- Check on the server:
75
-
76
- ```bash
77
- ls -la /var/www/shipfe-demo
78
- ls -la /var/www/shipfe-demo/current
79
- ```
80
-
81
- Or directly access your domain/server address.
82
-
83
- ## 6. Rollback to a Specific Version
84
-
85
- Rollback to a specific timestamp version (example):
86
-
87
- ```bash
88
- shipfe rollback --profile prod --to 20260303_034945
89
- ```
90
-
91
- Timestamps come from the `releases/` directory names.
92
-
93
- ## Next Steps
94
-
95
- - Config details: [/config/overview](/config/overview)
96
- - Deploy command parameters: [/commands/deploy](/commands/deploy)
97
- - Atomic deployment principles: [/features/atomic](/features/atomic)
98
- - Shared asset management: [/features/shared-assets](/features/shared-assets)
@@ -1,88 +0,0 @@
1
- # Troubleshooting
2
-
3
- ## Common Issues
4
-
5
- ### 1. Permission Denied Error
6
-
7
- ```
8
- Error: Permission denied (publickey)
9
- ```
10
-
11
- **Solutions:**
12
- - Verify SSH key is added to server's `~/.ssh/authorized_keys`
13
- - Check SSH key permissions: `chmod 600 ~/.ssh/id_rsa`
14
- - Test SSH connection: `ssh user@host`
15
-
16
- ### 2. Shared Resources Not Working
17
-
18
- ```
19
- Warning: Failed to create hard link for shared asset
20
- ```
21
-
22
- **Solutions:**
23
- - Ensure `enable_shared: true` in configuration
24
- - Check if server filesystem supports hard links
25
- - Verify write permissions for shared directory
26
-
27
- ### 3. Cleanup Not Working
28
-
29
- ```
30
- Warning: Failed to remove old release
31
- ```
32
-
33
- **Solutions:**
34
- - Check file permissions in releases directory
35
- - Ensure no processes are using old release files
36
- - Verify `keep_releases` setting is correct
37
-
38
- ### 4. Snapshot Creation Failed
39
-
40
- ```
41
- Error: Failed to create snapshot
42
- ```
43
-
44
- **Solutions:**
45
- - Check available disk space
46
- - Verify write permissions for releases directory
47
- - Ensure tar command is available on server
48
-
49
- ## Debug Mode
50
-
51
- Enable verbose logging:
52
-
53
- ```bash
54
- shipfe deploy --debug
55
- ```
56
-
57
- ## Log Paths
58
-
59
- Shipfe log files are typically located at:
60
-
61
- - Local: `shipfe.log`
62
- - Server: `shipfe.log` in deployment directory
63
-
64
- Check logs:
65
-
66
- ```bash
67
- tail -f shipfe.log
68
- ```
69
-
70
- ## Performance Optimization
71
-
72
- ### Slow Deployments
73
-
74
- - Enable shared resources for large static files
75
- - Use `hashed_asset_patterns` for specific files
76
- - Consider excluding large non-changing files from patterns
77
-
78
- ### High Disk Usage
79
-
80
- - Reduce `keep_releases` count
81
- - Enable shared resources
82
- - Use `delete_old: true` for single release deployments
83
-
84
- ### Network Issues
85
-
86
- - Compress large files before deployment
87
- - Use faster SSH ciphers if supported
88
- - Consider deploying during off-peak hours