Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
問題描述
此 PR 解決了 Issue #10,新增了支援為每個 repo 配置 N 個 workers 的部署腳本,預設值為 3 個 workers。
變更摘要
新增檔案
deployment/gen-compose.sh - 可執行的部署腳本
deployment/README.md - 完整的使用文件
主要功能
命令列選項
-w, --workers NUM: 指定每個 repo 的 worker 數量(預設:3)-o, --output FILE: 指定輸出檔案名稱(預設:docker-compose.yml)-h, --help: 顯示說明訊息腳本特點
輸入驗證:驗證 worker 數量為正整數
Docker Compose 生成:
網路配置:建立 bridge 網路供 runners 通訊
卷冊管理:為每個 worker 建立命名卷冊,確保資料持久性
使用範例
```bash
使用預設 3 個 workers 生成
./deployment/gen-compose.sh
生成 5 個 workers
./deployment/gen-compose.sh -w 5
生成 10 個 workers,自訂輸出檔案
./deployment/gen-compose.sh -w 10 -o runners.yml
```
測試執行
已完成以下測試:
技術細節
生成的 Docker Compose 結構
關聯 Issue
Fixes #10
此 PR 由 beaver-the-worker worker-v0.2.6 自動產生