|
|
@ -37,7 +37,7 @@ func Setup() (err error) { |
|
|
|
pathHash = fmt.Sprintf("%x", md5.Sum([]byte(yamlPath)))[:9] |
|
|
|
pathHash = fmt.Sprintf("%x", md5.Sum([]byte(yamlPath)))[:9] |
|
|
|
var args = []string{"-f", yamlPath, "-p", pathHash, "up", "-d"} |
|
|
|
var args = []string{"-f", yamlPath, "-p", pathHash, "up", "-d"} |
|
|
|
if err = exec.Command("docker-compose", args...).Run(); err != nil { |
|
|
|
if err = exec.Command("docker-compose", args...).Run(); err != nil { |
|
|
|
log.Printf("exec.Command(docker-composer) args(%v) error(%v)", args, err) |
|
|
|
log.Printf("exec.Command(docker-compose) args(%v) error(%v)", args, err) |
|
|
|
Teardown() |
|
|
|
Teardown() |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -67,7 +67,7 @@ func Teardown() (err error) { |
|
|
|
pathHash = fmt.Sprintf("%x", md5.Sum([]byte(yamlPath)))[:9] |
|
|
|
pathHash = fmt.Sprintf("%x", md5.Sum([]byte(yamlPath)))[:9] |
|
|
|
args := []string{"-f", yamlPath, "-p", pathHash, "down"} |
|
|
|
args := []string{"-f", yamlPath, "-p", pathHash, "down"} |
|
|
|
if output, err := exec.Command("docker-compose", args...).CombinedOutput(); err != nil { |
|
|
|
if output, err := exec.Command("docker-compose", args...).CombinedOutput(); err != nil { |
|
|
|
log.Fatalf("exec.Command(docker-composer) args(%v) stdout(%s) error(%v)", args, string(output), err) |
|
|
|
log.Fatalf("exec.Command(docker-compose) args(%v) stdout(%s) error(%v)", args, string(output), err) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|
return |
|
|
@ -76,7 +76,7 @@ func Teardown() (err error) { |
|
|
|
func getServices() (output []byte, err error) { |
|
|
|
func getServices() (output []byte, err error) { |
|
|
|
var args = []string{"-f", yamlPath, "-p", pathHash, "config", "--services"} |
|
|
|
var args = []string{"-f", yamlPath, "-p", pathHash, "config", "--services"} |
|
|
|
if output, err = exec.Command("docker-compose", args...).CombinedOutput(); err != nil { |
|
|
|
if output, err = exec.Command("docker-compose", args...).CombinedOutput(); err != nil { |
|
|
|
log.Printf("exec.Command(docker-composer) args(%v) stdout(%s) error(%v)", args, string(output), err) |
|
|
|
log.Printf("exec.Command(docker-compose) args(%v) stdout(%s) error(%v)", args, string(output), err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
services = make(map[string]*Container) |
|
|
|
services = make(map[string]*Container) |
|
|
@ -84,7 +84,7 @@ func getServices() (output []byte, err error) { |
|
|
|
for _, svr := range bytes.Split(output, []byte("\n")) { |
|
|
|
for _, svr := range bytes.Split(output, []byte("\n")) { |
|
|
|
args = []string{"-f", yamlPath, "-p", pathHash, "ps", "-a", "-q", string(svr)} |
|
|
|
args = []string{"-f", yamlPath, "-p", pathHash, "ps", "-a", "-q", string(svr)} |
|
|
|
if output, err = exec.Command("docker-compose", args...).CombinedOutput(); err != nil { |
|
|
|
if output, err = exec.Command("docker-compose", args...).CombinedOutput(); err != nil { |
|
|
|
log.Printf("exec.Command(docker-composer) args(%v) stdout(%s) error(%v)", args, string(output), err) |
|
|
|
log.Printf("exec.Command(docker-compose) args(%v) stdout(%s) error(%v)", args, string(output), err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
var id = string(bytes.TrimSpace(output)) |
|
|
|
var id = string(bytes.TrimSpace(output)) |
|
|
|