2023-03-30 16:47:47 +08:00
|
|
|
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)
|
|
|
|
}
|