Skip to content

v0.3.0

Choose a tag to compare

@pardnchiu pardnchiu released this 18 Jan 04:22
· 16 commits to master since this release

Update Log

Generated: 2026-01-18 16:15
v0.2.0 → v0.3.0

Recommended Commit Message

feat: Add container deployment via SSH with rsync synchronization

翻譯 feat: 新增透過 SSH 進行容器部署與 rsync 同步功能

Summary

Add complete container deployment workflow including SSH connection validation, file synchronization via rsync, and remote podman compose execution. Introduce PostgreSQL database integration for future deployment tracking.

翻譯 新增完整的容器部署流程,包含 SSH 連線驗證、透過 rsync 進行檔案同步、以及遠端 podman compose 執行。引入 PostgreSQL 資料庫整合,為未來部署追蹤做準備。

Changes

FEAT

  • Add Up() method for deploying containers to remote server via SSH and podman compose
  • Add Deploy struct to represent deployment metadata (UID, PodID, LocalDir, RemoteDir, Status, etc.)
  • Add CheckSSHConnection() function to validate SSH connectivity before deployment
  • Add RsyncToRemote() method for synchronizing local files to remote server with exclusion patterns
  • Add command routing in main.go for domain, deploy, up subcommands
  • Add SSHRun() and SSEOutput() utility functions for remote command execution
  • Add CMDOutput() utility function for capturing local command output
  • Add modifyComposeFile() to strip host ports and add SELinux :z labels for volume mounts
翻譯
  • 新增 Up() method,透過 SSH 與 podman compose 部署容器至遠端伺服器
  • 新增 Deploy struct 表示部署 metadata(UID、PodID、LocalDir、RemoteDir、Status 等)
  • 新增 CheckSSHConnection() 函式,於部署前驗證 SSH 連線
  • 新增 RsyncToRemote() method,使用排除規則同步本地檔案至遠端伺服器
  • 新增 main.go 命令路由,支援 domain、deploy、up 子命令
  • 新增 SSHRun() 與 SSEOutput() 工具函式執行遠端命令
  • 新增 CMDOutput() 工具函式擷取本地命令輸出
  • 新增 modifyComposeFile() 移除 host ports 並為 volume mounts 加入 SELinux :z 標籤

UPDATE

  • Update setRemoteDir() to return UID (MD5 hash) along with remote directory path
  • Change default Target from "pod" to "podman"
  • Update CMDRun() (formerly CmdExec()) to attach stdin for interactive commands
翻譯
  • 更新 setRemoteDir() 同時回傳 UID(MD5 hash)與遠端目錄路徑
  • 將預設 Target 從 "pod" 改為 "podman"
  • 更新 CMDRun()(原 CmdExec())附加 stdin 以支援互動式命令

FIX

  • Fix getLocalDir() to properly handle filepath.Abs() error instead of ignoring it
  • Improve error messages in getLocalDir() for clarity
翻譯
  • 修正 getLocalDir() 正確處理 filepath.Abs() 錯誤,而非忽略
  • 改善 getLocalDir() 錯誤訊息的清晰度

REFACTOR

  • Rename CmdExec() to CMDRun() for naming consistency with CMDOutput()
翻譯
  • 將 CmdExec() 重新命名為 CMDRun() 以與 CMDOutput() 命名一致

Files Changed

File Status Tag
cmd/cli/main.go Modified FEAT
internal/command/command.go Modified UPDATE
internal/command/checkSSHConnection.go Added FEAT
internal/command/up.go Added FEAT
internal/utils/utils.go Modified FEAT
internal/utils/checkRelyPackages.go Modified REFACTOR

Generated by Claude Code