@@ -31,28 +31,28 @@ func NewComposeWrapper(binaryPath, configPath string) (libstack.Deployer, error)
31
31
return & ComposeWrapper {binaryPath : binaryPath , configPath : configPath }, nil
32
32
}
33
33
34
- // Up create and start containers
34
+ // Deploy creates and starts containers
35
35
func (wrapper * ComposeWrapper ) Deploy (ctx context.Context , workingDir , host , projectName string , filePaths []string , envFilePath string ) error {
36
- output , err := wrapper .Command (newUpCommand (filePaths ), workingDir , host , projectName , envFilePath , wrapper . configPath )
36
+ output , err := wrapper .Command (newUpCommand (filePaths ), workingDir , host , projectName , envFilePath )
37
37
if len (output ) != 0 {
38
38
log .Printf ("[libstack,composebinary] [message: finish deploying] [output: %s] [err: %s]" , output , err )
39
39
}
40
40
41
41
return err
42
42
}
43
43
44
- // Down stop and remove containers
44
+ // Remove stops and removes containers
45
45
func (wrapper * ComposeWrapper ) Remove (ctx context.Context , workingDir , host , projectName string , filePaths []string ) error {
46
- output , err := wrapper .Command (newDownCommand (filePaths ), workingDir , host , projectName , "" , "" )
46
+ output , err := wrapper .Command (newDownCommand (filePaths ), workingDir , host , projectName , "" )
47
47
if len (output ) != 0 {
48
48
log .Printf ("[libstack,composebinary] [message: finish deploying] [output: %s] [err: %s]" , output , err )
49
49
}
50
50
51
51
return err
52
52
}
53
53
54
- // Command exectue a docker-compose commanåd
55
- func (wrapper * ComposeWrapper ) Command (command composeCommand , workingDir , host , projectName , envFilePath , configPath string ) ([]byte , error ) {
54
+ // Command executes a docker-compose command
55
+ func (wrapper * ComposeWrapper ) Command (command composeCommand , workingDir , host , projectName , envFilePath string ) ([]byte , error ) {
56
56
program := utils .ProgramPath (wrapper .binaryPath , "docker-compose" )
57
57
58
58
if projectName != "" {
@@ -71,9 +71,9 @@ func (wrapper *ComposeWrapper) Command(command composeCommand, workingDir, host,
71
71
cmd := exec .Command (program , command .ToArgs ()... )
72
72
cmd .Dir = workingDir
73
73
74
- if configPath != "" {
74
+ if wrapper . configPath != "" {
75
75
cmd .Env = os .Environ ()
76
- cmd .Env = append (cmd .Env , fmt .Sprintf ("DOCKER_CONFIG=%s" , configPath ))
76
+ cmd .Env = append (cmd .Env , fmt .Sprintf ("DOCKER_CONFIG=%s" , wrapper . configPath ))
77
77
}
78
78
79
79
cmd .Stderr = & stderr
0 commit comments