(runtime *model.Runtime)
| 160 | } |
| 161 | |
| 162 | func reCreateRuntime(runtime *model.Runtime) { |
| 163 | var err error |
| 164 | defer func() { |
| 165 | if err != nil { |
| 166 | runtime.Status = constant.StatusError |
| 167 | runtime.Message = err.Error() |
| 168 | _ = runtimeRepo.Save(runtime) |
| 169 | } |
| 170 | }() |
| 171 | if err = runComposeCmdWithLog("down", runtime.GetComposePath(), runtime.GetLogPath()); err != nil { |
| 172 | return |
| 173 | } |
| 174 | if err = runComposeCmdWithLog("up", runtime.GetComposePath(), runtime.GetLogPath()); err != nil { |
| 175 | return |
| 176 | } |
| 177 | if err := SyncRuntimeContainerStatus(runtime); err != nil { |
| 178 | return |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | func getComposeCmd(composePath, operate string) *exec.Cmd { |
| 183 | dockerCommand := global.CONF.DockerConfig.Command |
no test coverage detected