Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Capistrano SFTP recipe (See related posts)

// webistrano recipe used to deploy with sftp access only

desc "Setup the rail environment"
namespace :deploy do
    task :setup do

    end

  task :default do
     update_code
     restart
  end

  task :update_code, :except => { :no_release => true } do
    on_rollback { run "rm -rf #{release_path}; true" }
    strategy.deploy!
  end

  task :symlink, :except => { :no_release => true } do

  end

  task :restart, :roles => :app do
     Net::SSH.start(host, user, password) do |ssh|
        ssh.sftp.connect do |sftp|
            sftp.remove("#{restart_file}")
        end
     end
  end
end



You need to create an account or log in to post comments to this site.


Related Posts