def deploy_file_from_url(rest_app, file_url, hot_deploy, force_clean_build)
say "Deployment of file '#{file_url}' in progress for application #{rest_app.name} ..."
ssh_url = URI(rest_app.ssh_url)
file_url = URI(file_url)
remote_cmd = "oo-binary-deploy#{hot_deploy ? ' --hot-deploy' : ''}#{force_clean_build ? ' --force-clean-build' : ''}"
begin
ssh_send_url_ruby(ssh_url.host, ssh_url.user, remote_cmd, file_url)
success "Success"
rescue
ssh_cmd = "ssh -t #{ssh_url.user}@#{ssh_url.host} '#{remote_cmd}'"
warn "Error deploying file from url. You can try to deploy manually with:\n#{ssh_cmd}"
raise
end
end