1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 22:18:07 +08:00
1Panel/backend/app/service/runtime_utils.go

20 lines
567 B
Go
Raw Normal View History

package service
2023-03-31 14:02:28 +08:00
import (
"github.com/1Panel-dev/1Panel/backend/app/model"
"github.com/1Panel-dev/1Panel/backend/buserr"
"github.com/1Panel-dev/1Panel/backend/constant"
"github.com/1Panel-dev/1Panel/backend/utils/docker"
)
func buildRuntime(runtime *model.Runtime, service *docker.ComposeService) {
err := service.ComposeBuild()
if err != nil {
runtime.Status = constant.RuntimeError
runtime.Message = buserr.New(constant.ErrImageBuildErr).Error() + ":" + err.Error()
} else {
runtime.Status = constant.RuntimeNormal
}
_ = runtimeRepo.Save(runtime)
}