Questions tagged [sshkit]

sshkit is a toolkit for deploying code and assets to servers in a repeatable, testable, reliable way.

SSHKit is a toolkit for deploying code and assets to servers in a repeatable, testable, reliable way. In other words, SSHKit is a toolkit for running commands in a structured way on one or more servers.

SSHKit provides a convenient set of API which are nestable in any order, repeatable, and stackable. There are some helper APIs also which are convenient helpers for Ruby, and Rails based apps.

SSHKit uses a simple connection pool (enabled by default) to reduce the cost of negotiating a new SSH connection for every on() block. Depending on usage and network conditions, this can add up to a significant time savings. In one test, a basic cap deploy ran 15-20 seconds faster thanks to the connection pooling added in recent versions of SSHKit. It provides concurrency handling, sane error checking and control flow that would otherwise be difficult to achieve with pure Net::SSH.

You should use this tag if your question is related with SSHkit toolkit usage.

42 questions
1
vote
0 answers

Getting Exception in deploying on server , How to resolve this?

I am using capistrano to deploy on ubuntu server Brief Response : while executing as ubuntu@planhop.net: invalid encoding Logs attached below Here is detailed response: ** Invoke staging (first_time) ** Execute staging ** Invoke…
1
vote
1 answer

Ruby sshkit IPv6 string addressing issues

I'm sure this is an issue on my end that I'm fundamentally misunderstanding. I am using sshkit to connect to and upload some files to a server with IPv6 addressing. I can SSH into a server with an address like…
ry_donahue
  • 505
  • 2
  • 13
1
vote
0 answers

Custom remote task is not executed with capistrano 3

I run into a weird issue with capistrano 3 and brunch. I want to execute brunch on remote server but nothing happen. My custom remote task looks like this: namespace :brunch do desc "Building assets with brunch.io" task :build do on…
1
vote
1 answer

Custom output with capistrano 3

I need to change output which is generated with sshkit formatters, and I can't install additional gems, but I can adjust my capistrano 3 configs. At first I tried just create new Formatter (I just copy paste pretty formatter, and made some output…
dpa
  • 427
  • 4
  • 16
1
vote
1 answer

Capistrano 3 / SSHKit.config.umask not working

I'm trying to run a test command with SSHKit.config.umask configured: deploy.rb: SSHKit.config.umask = '777' deploy.rake namespace :deploy do task :test do on roles :web do execute('touch ~/hello.txt') end end end I expect…
robd
  • 9,646
  • 5
  • 40
  • 59
1
vote
1 answer

Cap aborted SSHKit error

I am trying to deploy my rails app with capistrano and I am getting the following error after the command: cap production deploy Output: DEBUG[a3e9636c] Running /usr/bin/env [ -d ~/.rvm ] on handco-op.com DEBUG[a3e9636c] Command: [ -d ~/.rvm ] cap…
ZachyBear
  • 297
  • 3
  • 15
1
vote
2 answers

Declaring and using ruby functions within capistrano 3 tasks

I have the same problem described here: How to call a Capistrano's task within another Capistrano's task? However the workaround solution of rolling back to Capistrano v3.0.1 and sshkit 1.0 does not work for me. Using this tutorial, I have declared…
Nick Abbey
  • 63
  • 2
  • 8
1
vote
1 answer

Capistrano isn't applying path environment to second command

My Capistrano deployments are hanging on the second command in a composite command. https://github.com/capistrano/capistrano/blob/5986983915163e6681f2546bf6fad599d58cd024/lib/capistrano/dsl.rb#L59 At the point that SSHKit tries to run the following…
etc
  • 565
  • 3
  • 18
1
vote
1 answer

display output from a rake task called by SSHKit

I'd like to be able to output information from a rake task called by SSHKit but I can't see how to do it. Say I have the following rake tasks: require 'sshkit/dsl' task :hello => :environment do puts "Hello world" end task :sshkit_hello =>…
Chris Lewis
  • 1,315
  • 10
  • 25
0
votes
2 answers

Rails 7 deployment fails using capistrano with SSHKit::Runner::ExecuteError

I am trying to deploy a Rails 7 app to a Vultr VPS for the very first time using Capistrano. I followed this guide on GoRails.com. All goes well up to the final step: deploy the app using Capistrano. My setup is as follows: Ubuntu 22.04.2 LTS Jammy…
user792649
  • 51
  • 1
  • 4
0
votes
1 answer

How to ask for a user input from a remote server with SSHKit?

I need to ask a user input from a ruby script on a remote server. I managed to perform it with bash with the following code class ConfirmHandler def on_data(command, stream_name, data, channel) puts "data received: #{data}" if data.to_s =~…
Hirurg103
  • 4,783
  • 2
  • 34
  • 50
0
votes
1 answer

SSHKit command or Capistrano task to filter/replace tokens on upload

I'm using Capistrano to deploy configuration files for a legacy non-Ruby application, that for arcane legacy reasons need to be parameterized with the fully-qualified name of the target host, e.g. name: myservice-stg identifier:…
David Moles
  • 48,006
  • 27
  • 136
  • 235
0
votes
0 answers

cap aborted! SSHKit::Runner::ExecuteError: and Net::SSH::AuthenticationFailed for user

I have been trying to deploy a Rails app using Capistrano but when I run cap production deploy I get: (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as deploy@12.34.56.789:…
Kehinde
  • 11
  • 4
0
votes
0 answers

NameError: uninitialized constant SSHKit::Logger::ANY

Whenever I cap production deploy, I get the following error: (Backtrace restricted to imported tasks) cap aborted! NameError: uninitialized constant SSHKit::Logger::ANY Capfile: require 'capistrano/setup' require 'capistrano/deploy' require…
sadtroll
  • 191
  • 4
  • 17