Capistrano change SCP to SFTP setting

228 views
Skip to first unread message

Asped

unread,
Sep 9, 2015, 4:44:19 AM9/9/15
to Capistrano
I tried to set up a simple capistrano deployment, and get the following error when deploying:

    SSHKit::Runner::ExecuteError: Exception while executing as
    us...@server.com: SCP did not finish successfully (126):
    Net::SCP::Error: SCP did not finish successfully (126):

I do not want Cap to use SCP as my provider does not allow it. There should be a possibility to change this setting to SFTP but I cannot find any info about where to change it.

I am using a GIT repository for deployment, so Cap should not upload any files, just execute som ssh commands to create some directories and download the repository from git.

Any idea how to set this up?

My production.rb only contains a line similar to this:

`role:web,%w[us...@server.com:10022]`

My deploy.rb similar to this:

    # config valid only for current version of Capistrano
    lock '3.4.0'
   
    set :application, 'My App'
    set :repo_url, 'g...@gitlab.com.....'
   
    # Default branch is :master
    # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
   
    # Default deploy_to directory is /var/www/my_app_name
    set :deploy_to, '/home/user/cap'


    namespace :deploy do
   
      after :restart, :clear_cache do
        on roles(:web), in: :groups, limit: 3, wait: 10 do
          # Here we can do anything such as:
          # within release_path do
          #   execute :rake, 'cache:clear'
          # end
        end
      end
   
    end


Thanks



Lee Hambley

unread,
Sep 9, 2015, 4:45:07 AM9/9/15
to Capistrano
Capistrano relies on uploading a Git wrapper script to force some Git options otherwise you risk a hanging process. It is not possible to change the upload method from SCP to SFTP, you might try patching the Git wrapper command out, and replacing it with one of your own construction.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/331ccf22-3c9d-4343-a465-c6d3aacf4261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages