1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: 解决应用重建失败的问题 (#3967)

This commit is contained in:
zhengkunwang 2024-02-23 18:38:40 +08:00 committed by GitHub
parent 58f58f0fac
commit f0d5aca657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -903,27 +903,11 @@ func rebuildApp(appInstall model.AppInstall) error {
_ = handleErr(appInstall, err, out)
return
}
fileOp := files.NewFileOp()
envByte, err := fileOp.GetContent(appInstall.GetEnvPath())
out, err = compose.Up(appInstall.GetComposePath())
if err != nil {
_ = handleErr(appInstall, err, out)
return
}
composeByte, err := fileOp.GetContent(dockerComposePath)
if err != nil {
_ = handleErr(appInstall, err, out)
return
}
project, err := composeV2.GetComposeProject(appInstall.Name, appInstall.GetPath(), composeByte, envByte, true)
if err != nil {
_ = handleErr(appInstall, err, out)
return
}
if err = composeV2.UpComposeProject(project); err != nil {
_ = handleErr(appInstall, err, out)
return
}
appInstall.Status = constant.Running
_ = appInstallRepo.Save(context.Background(), &appInstall)