feat: 编排增加编辑功能
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package compose
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/compose-spec/compose-go/loader"
|
||||
"github.com/compose-spec/compose-go/types"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func Up(filePath string) (string, error) {
|
||||
@@ -30,6 +31,12 @@ func Restart(filePath string) (string, error) {
|
||||
return string(stdout), err
|
||||
}
|
||||
|
||||
func Operate(filePath, operation string) (string, error) {
|
||||
cmd := exec.Command("docker-compose", "-f", filePath, operation)
|
||||
stdout, err := cmd.CombinedOutput()
|
||||
return string(stdout), err
|
||||
}
|
||||
|
||||
func Rmf(filePath string) (string, error) {
|
||||
cmd := exec.Command("docker-compose", "-f", filePath, "rm", "-f")
|
||||
stdout, err := cmd.CombinedOutput()
|
||||
|
||||
Reference in New Issue
Block a user