fix: 解决删除应用失败的BUG

This commit is contained in:
zhengkunwang223
2022-12-06 18:43:55 +08:00
committed by zhengkunwang223
parent 3f02358708
commit 9b5ea3f317
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ func (a AppInstallService) Operate(req dto.AppInstallOperate) error {
}
install.Status = constant.Running
case dto.Down:
out, err := compose.Down(dockerComposePath)
out, err := compose.Stop(dockerComposePath)
if err != nil {
return handleErr(install, err, out)
}
+6
View File
@@ -13,6 +13,12 @@ func Up(filePath string) (string, error) {
}
func Down(filePath string) (string, error) {
cmd := exec.Command("docker-compose", "-f", filePath, "down")
stdout, err := cmd.CombinedOutput()
return string(stdout), err
}
func Stop(filePath string) (string, error) {
cmd := exec.Command("docker-compose", "-f", filePath, "stop")
stdout, err := cmd.CombinedOutput()
return string(stdout), err