使用Capistrano通过FTP部署(非Rails站点)? [英] Using Capistrano to deploy (a non-Rails site) via FTP?

查看:112
本文介绍了使用Capistrano通过FTP部署(非Rails站点)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么做?



我有一个大部分是静态的网站,它被托管在便宜的网络主机上,只允许FTP访问托管。该站点以git进行跟踪。我正在使用OS X。



我想通过简单地执行 cap deploy 来上传新版本的网站

解决方案

我们使用capistrano来部署我们用PHP编写的网站。



从内存(我现在不在工作)我们重新部署并使用rsync通过sftp进行同步。这样的东西:

  desc同步
命名空间:deploy do

desc默认同步远程
任务:默认
remote.default
end

命名空间:remote do

desc与远程服务器同步
任务:默认
`rsync -avz/ path / to / webapp#{remote_host}:#{remote_root} / path / to / webapp `
end
end
end

我确信你可以用任何一个ftp程序替换rsync,它应该可以正常工作。


How would I go about this?

I have a mostly static site, which is being hosted on a cheap web-host, which only allows FTP access to the hosting. The site is tracked in git. I am using OS X.

I would like to upload a new version of the site by simply doing cap deploy

解决方案

We use capistrano to deploy our site which is written in PHP.

From memory (I'm not at work right now) we overload deploy and used rsync to sync over sftp. Something like this:

desc "Sync"
namespace :deploy do

  desc "Sync remote by default"
  task :default do
    remote.default
  end

  namespace :remote do

      desc "Sync to remote server"
      task :default do
          `rsync -avz "/path/to/webapp" "#{remote_host}:#{remote_root}/path/to/webapp"`
      end
  end
end

I'm sure you could replace rsync with whatever an ftp program and it should work fine.

这篇关于使用Capistrano通过FTP部署(非Rails站点)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆