Skip to content

Commit

Permalink
Merge pull request #5 from xetorthio/do_stack_deploy
Browse files Browse the repository at this point in the history
Initialize swarm and do stack deploy instead of docker compose
  • Loading branch information
marcosnils committed May 18, 2017
2 parents a585711 + 0a061c2 commit 59eee7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59eee7c

Please sign in to comment.