Merge pull request #5 from xetorthio/do_stack_deploy
Initialize swarm and do stack deploy instead of docker compose
This commit is contained in:
@@ -111,9 +111,14 @@ func (s *Session) DeployStack() error {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = Exec(i.Name, []string{"docker", "swarm", "init", "--advertise-addr", "eth0"})
|
||||
if err != nil {
|
||||
log.Printf("Error executing stack [%s]: %s\n", s.Stack, err)
|
||||
return err
|
||||
}
|
||||
w := sessionBuilderWriter{session: s}
|
||||
fileName := path.Base(s.Stack)
|
||||
code, err := ExecAttach(i.Name, []string{"docker-compose", "-f", "/var/run/pwd/uploads/" + fileName, "up", "-d"}, &w)
|
||||
code, err := ExecAttach(i.Name, []string{"docker", "stack", "deploy", "-c", "/var/run/pwd/uploads/" + fileName, "pwd"}, &w)
|
||||
if err != nil {
|
||||
log.Printf("Error executing stack [%s]: %s\n", s.Stack, err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user