mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-16 18:54:43 +08:00
fix: 解决应用重建失败的问题 (#3967)
This commit is contained in:
parent
58f58f0fac
commit
f0d5aca657
@ -903,27 +903,11 @@ func rebuildApp(appInstall model.AppInstall) error {
|
|||||||
_ = handleErr(appInstall, err, out)
|
_ = handleErr(appInstall, err, out)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fileOp := files.NewFileOp()
|
out, err = compose.Up(appInstall.GetComposePath())
|
||||||
envByte, err := fileOp.GetContent(appInstall.GetEnvPath())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = handleErr(appInstall, err, out)
|
_ = handleErr(appInstall, err, out)
|
||||||
return
|
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
|
appInstall.Status = constant.Running
|
||||||
_ = appInstallRepo.Save(context.Background(), &appInstall)
|
_ = appInstallRepo.Save(context.Background(), &appInstall)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user