services/internal/actions/stop.go

25 lines
409 B
Go
Raw Normal View History

package actions
import (
"flow/services/internal"
"fmt"
"os"
"github.com/magefile/mage/sh"
)
func Stop(dockerHost, environment, service string) error {
os.Setenv("DOCKER_HOST", dockerHost)
command := []string{
"docker",
"compose",
"--project-directory",
fmt.Sprintf("%s/%s/compose", internal.RootBuildDir, environment),
"stop",
service,
}
return sh.RunV(command[0], command[1:]...)
}