Skip to content

[Feature Idea] SSH Remote Execution #41

Description

@albertalef

Problem: Running commands on remote servers requires manually constructing SSH command strings, losing the clean RubyShell syntax and making deployment scripts verbose.

Solution: Add sh.remote to execute RubyShell blocks on remote servers via SSH, bringing the same familiar syntax to remote administration.

sh.remote("user@server") do
  ls("-la")
  cat("/etc/hostname")
end

sh.remote("deploy@production", port: 2222) do
  cd("/var/www/app")
  git("pull", "origin", "main")
  bundle("install")
  systemctl("restart", "app")
end

%w[web1 web2 web3].each do |server|
  sh.remote("admin@#{server}.example.com") do
    apt("update")
  end
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions