support ssh deployemnt

This commit is contained in:
yoan
2024-08-22 20:24:00 +08:00
parent 1bfd477587
commit bcd8f8dea1
15 changed files with 1060 additions and 23 deletions

View File

@@ -16,6 +16,7 @@ const (
const (
targetAliyunOss = "aliyun-oss"
targetAliyunCdn = "aliyun-cdn"
targetSSH = "ssh"
)
type DeployerOption struct {
@@ -47,6 +48,8 @@ func Get(record *models.Record) (Deployer, error) {
return NewAliyun(option)
case targetAliyunCdn:
return NewAliyunCdn(option)
case targetSSH:
return NewSSH(option)
}
return nil, errors.New("not implemented")
}
@@ -54,5 +57,8 @@ func Get(record *models.Record) (Deployer, error) {
func getProduct(record *models.Record) string {
targetType := record.GetString("targetType")
rs := strings.Split(targetType, "-")
if len(rs) < 2 {
return ""
}
return rs[1]
}