Deploying Java Applications with Capistrano 6
Capistrano 2, the fantastic sequel to the already superb Rails deployment framework, is an excellent solution to the otherwise mundane task of deploying Java applications.
Network security restrictions prohibit me from using the typically SCM -> Production server configuration. Next, I ran into a few problems uploading Jar files using the put command. Luckily Alex Gorbatchev, posted an example of how to use SFTP within a Capistrano deployment recipe.
I used his idea and adapted my rails recipe using SFTP deployment.
namespace :deploy do
task :update_code do
on_rollback { run "rm -rf #{release_path}" }
run "mkdir #{release_path}"
files = Dir.glob('lib/*.jar') + Dir.glob('dist/*.jar')
execute_on_servers(options) do |servers|
servers.each do |server|
files.each do |path|
logger.info "uploading #{File.basename(path)} to #{server}"
sftp = sessions[server].sftp
sftp.connect unless sftp.state == :open
sftp.put_file path, File.join(current_path, File.basename(path))
logger.debug "done uploading #{File.basename(path)} to #{server}"
end
end
end
finalize_update
end
end

Thanks for this great post. Did you do it all on your own? This must’ve taken a lot of time
Great read You might want to follow up to this topic
I am not sure where you are getting your information, but great topic
the blog post is really the freshest on this noteworthy theme. I harmonize with your conclusions and will thirstily look forward to hear your coming updates. I will tell you something about useful Welded wire mesh,wire meshes and so on.
That’s an inenigous way of thinking about it.
qxnGsD xzikgztfrzgu