mirror of https://github.com/1Panel-dev/1Panel
feat: 修改应用升级流程 (#2831)
parent
80f916f4c7
commit
fbc34c2847
|
@ -419,6 +419,16 @@ func upgradeInstall(installId uint, detailId uint, backup bool) error {
|
|||
_, _ = scriptCmd.CombinedOutput()
|
||||
}
|
||||
|
||||
if detail.DockerCompose == "" {
|
||||
composeDetail, err := fileOp.GetContent(path.Join(detailDir, "docker-compose.yml"))
|
||||
if err != nil {
|
||||
upErr = err
|
||||
return
|
||||
}
|
||||
detail.DockerCompose = string(composeDetail)
|
||||
_ = appDetailRepo.Update(context.Background(), detail)
|
||||
}
|
||||
|
||||
composeMap := make(map[string]interface{})
|
||||
if upErr = yaml.Unmarshal([]byte(detail.DockerCompose), &composeMap); upErr != nil {
|
||||
return
|
||||
|
|
|
@ -40,7 +40,7 @@ func getDomain(domainStr string, defaultPort int) (model.WebsiteDomain, error) {
|
|||
portStr := domainArray[1]
|
||||
portN, err := strconv.Atoi(portStr)
|
||||
if err != nil {
|
||||
return model.WebsiteDomain{}, buserr.New("ErrTypePort")
|
||||
return model.WebsiteDomain{}, buserr.WithName("ErrTypePort", portStr)
|
||||
}
|
||||
if portN <= 0 || portN > 65535 {
|
||||
return model.WebsiteDomain{}, buserr.New("ErrTypePortRange")
|
||||
|
|
|
@ -18,7 +18,7 @@ ErrPortExist: '{{ .port }} port is already occupied by {{ .type }} [{{ .name }}]
|
|||
TYPE_APP: "Application"
|
||||
TYPE_RUNTIME: "Runtime environment"
|
||||
TYPE_DOMAIN: "Domain name"
|
||||
ErrTypePort: 'Port {{name}} format error'
|
||||
ErrTypePort: 'Port {{ .name }} format error'
|
||||
ErrTypePortRange: 'Port range needs to be between 1-65535'
|
||||
|
||||
#app
|
||||
|
|
|
@ -18,7 +18,7 @@ ErrPortExist: '{{ .port }} 埠已被 {{ .type }} [{{ .name }}] 佔用'
|
|||
TYPE_APP: "應用"
|
||||
TYPE_RUNTIME: "運作環境"
|
||||
TYPE_DOMAIN: "網域名稱"
|
||||
ErrTypePort: '埠 {{name}} 格式錯誤'
|
||||
ErrTypePort: '埠 {{ .name }} 格式錯誤'
|
||||
ErrTypePortRange: '連接埠範圍需要在 1-65535 之間'
|
||||
|
||||
#app
|
||||
|
|
|
@ -18,7 +18,7 @@ ErrPortExist: '{{ .port }} 端口已被 {{ .type }} [{{ .name }}] 占用'
|
|||
TYPE_APP: "应用"
|
||||
TYPE_RUNTIME: "运行环境"
|
||||
TYPE_DOMAIN: "域名"
|
||||
ErrTypePort: '端口 {{name}} 格式错误'
|
||||
ErrTypePort: '端口 {{ .name }} 格式错误'
|
||||
ErrTypePortRange: '端口范围需要在 1-65535 之间'
|
||||
|
||||
#app
|
||||
|
|
Loading…
Reference in New Issue