INNER CODE UNIT · Go
connectToServer
yarlson/ftl · cmd/deploy.go:112
func connectToServer(server *config.Server) (*remote.Runner, error) {
sshKeyPath := filepath.Join(os.Getenv("HOME"), ".ssh", filepath.Base(server.SSHKey))
sshClient, _, err := ssh.FindKeyAndConnectWithUser(server.Host, server.Port, server.User, sshKeyPath)
if err != nil {
return nil, err
}
return remote.NewRunner(sshClient), nil
}