Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteDeployHooks ¶
ExecuteDeployHooks 执行 pre-hook / 更新 currentLink / post-hook
Types ¶
type Config ¶
type Config struct {
Dir string `yaml:"dir"` // 部署根目录(本地或远程路径)
Version string `yaml:"version"` // 部署版本号,例如 v1.0.0 或 20260102153000
Include []string `yaml:"include"` // 需要包含的文件或目录列表
Exclude []string `yaml:"exclude"` // 需要排除的文件或目录列表
RemoteRepo string `yaml:"remoteRepo"` // 远程存放版本的目录,例如 /data/app/releases
CurrentLink string `yaml:"currentLink"` // 当前软链接路径,例如 /data/app/current
HookPre string `yaml:"hookPre"` // 部署前执行的钩子命令
HookPost string `yaml:"hookPost"` // 部署后执行的钩子命令
}
Config 部署配置结构体 包含本地、远程、版本、钩子等部署相关信息
func (*Config) GetCurrentLink ¶
GetCurrentLink 获取当前软链接路径 如果路径没有以 / 开头,会自动加上 / 例如 currentLink = "current" → "/current"
func (*Config) GetRemoteRepo ¶
GetRemoteRepo 获取远程存放版本的目录路径 如果路径没有以 / 开头,会自动加上 / 例如 remoteRepo = "data/app/releases" → "/data/app/releases"
func (*Config) GetVersionRemoteDir ¶
GetVersionRemoteDir 获取远程版本目录完整路径 例如 /data/app/releases/v1.0.0
Source Files
¶
- confg.go
- execute.go
- load.go
- pack.go
Click to show internal directories.
Click to hide internal directories.