Skip to content

Instantly share code, notes, and snippets.

@SteveRohrlack
Created September 20, 2016 12:26
Show Gist options
  • Save SteveRohrlack/29a3e70ef576ade55552bf0938497f91 to your computer and use it in GitHub Desktop.
Save SteveRohrlack/29a3e70ef576ade55552bf0938497f91 to your computer and use it in GitHub Desktop.
capistrano-dynamic-ssh-executable-path
# tested for capistrano 3.6.1
Rake::Task["deploy:check"].clear_actions
namespace :deploy do
task check: :'git:wrapper' do
on release_roles :all do
execute :mkdir, "-p", "#{fetch(:tmp_dir)}/#{fetch(:application)}/"
upload! StringIO.new("#!/bin/sh -e\nexec /usr/bin/env ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \"$@\"\n"),fetch(:git_wrapper_path)
execute :chmod, "+x", fetch(:git_wrapper_path)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment